How could I get data from 2 sources using merge node with option of remove Key Matches.
My goal is that data from source 1 move ahead where that was not contained in source 2.
This is my workflow example. The expected result should be
{'json':{'Email': '[email protected]', 'Nome': 'test'}}
{
"nodes": [
{
"parameters": {
"functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n\n// Loop over inputs and add a new field called 'myNewField' to the JSON of each one\n\nlet arr = [\n{'json':{'Email': '[email protected]', 'Nome': 'test_1'}},\n{'json':{'Email': '[email protected]', 'Nome': 'Test_2'}},\n{'json':{'Email': '[email protected]', 'Nome': 'test'}}\n];\n\n\nreturn arr;"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1320,
300
]
},
{
"parameters": {
"functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n\n// Loop over inputs and add a new field called 'myNewField' to the JSON of each one\n\nlet arr = [\n{'json':{'Email': '[email protected]', 'Nome': 'Test_2'}},\n{'json':{'Email': '[email protected]', 'Nome': 'test_4'}},\n{'json':{'Email': '[email protected]', 'Nome': 'test_1'}},\n];\n\n\nreturn arr;\n"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1320,
450
]
},
{
"parameters": {
"mode": "removeKeyMatches",
"propertyName1": "={{$node[\"Function\"].json[\"Email\"]}}",
"propertyName2": "={{$node[\"Function1\"].json[\"Email\"]}}"
},
"name": "Merge1",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
1690,
380
],
"notesInFlow": false
}
],
"connections": {
"Function": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Function1": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
}
}
}```