I am trying to filter a json with another json, to get the values which are present in both of them
Please share the workflow
```{
"nodes": [
{
"parameters": {
"filePath": "/home/n8n/Download/vergleich.json"
},
"name": "Read Binary File",
"type": "n8n-nodes-base.readBinaryFile",
"typeVersion": 1,
"position": [
-20,
60
]
},
{
"parameters": {
"filePath": "/home/n8n/Download/empirum.json"
},
"name": "Read Binary File1",
"type": "n8n-nodes-base.readBinaryFile",
"typeVersion": 1,
"position": [
-20,
300
]
},
{
"parameters": {
"functionCode": "const empirumImport = new Array ($items(\"empirumFunction\"));\nconst dellImport = new Array($items(\"dellFunction\"));\n\n\n\nvar haveDevice = dellImport.filter(function(dell){\n return empirumImport.filter(function(emp){\n return dell.Modell == emp.Name;\n\n })\n\n});\nreturn haveDevice;\nconsole.log(haveDevice);\n\n"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
540,
140
]
},
{
"parameters": {
"options": {
"encoding": "utf8"
}
},
"name": "dellImport",
"type": "n8n-nodes-base.moveBinaryData",
"typeVersion": 1,
"position": [
120,
60
]
},
{
"parameters": {
"options": {
"encoding": "utf8"
}
},
"name": "empirumImport",
"type": "n8n-nodes-base.moveBinaryData",
"typeVersion": 1,
"position": [
120,
300
]
},
{
"parameters": {
"functionCode": "const result = []\nfor (item of items) {\n for (json of item.json) {\n result.push({\n json: {...json }\n })\n }\n}\n\nreturn result"
},
"name": "empirumFunction",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
260,
300
]
},
{
"parameters": {
"functionCode": "const result = []\nfor (item of items) {\n for (json of item.json) {\n result.push({\n json: {...json }\n })\n }\n}\n\nreturn result"
},
"name": "dellFunction",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
260,
60
]
}
],
"connections": {
"Read Binary File": {
"main": [
[
{
"node": "dellImport",
"type": "main",
"index": 0
}
]
]
},
"Read Binary File1": {
"main": [
[
{
"node": "empirumImport",
"type": "main",
"index": 0
}
]
]
},
"dellImport": {
"main": [
[
{
"node": "dellFunction",
"type": "main",
"index": 0
}
]
]
},
"empirumImport": {
"main": [
[
{
"node": "empirumFunction",
"type": "main",
"index": 0
}
]
]
},
"empirumFunction": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"dellFunction": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
}
}
}
(Select the nodes and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow respectively)
## Share the output returned by the last node
<!-- If you need help with transforming the data, please also share the expected output -->
[
{
"json": {
"Modell": "Latitude 9520",
"Version": "A02",
"Link": "valid https link to dell website."
}
},
{
"json": {
"Modell": "Latitude 9510",
"Version": "A06",
"Link": "valid https link to dell website."
}
},
{
"json": {
"Modell": "Latitude 9420",
"Version": "A05",
"Link": "valid https link to dell website."
}
},
{
"json": {
"Modell": "Latitude 9410",
"Version": "A08",
"Link": "https://www .dell.com/s upport/kbdoc/ 000109721/la titude-9410 -window s-10-driver-pack"
}
},
{
"json": {
"Modell": "Latitude 7520",
"Version": "A03",
"Link": "valid https link to dell website."
}
},
{
"json": {
"Modell": "Latitude 7490",
"Version": "A15",
"Link": "valid https link to dell website."
}
},
{
"json": {
"Modell": "Latitude 7480",
"Version": "A15",
"Link": "valid https link to dell website."
}
}
]
]
The input data for dellFunction is as following:
[{
"Modell": "Latitude 9520",
"Version": "A02",
"Link": "https://ww w. dell. com/supp ort/kbdoc/000184698/latitude-9529-wind ows-10-driver-pack"
}]
and for empirumFunction its this:
{
"Name": "Latitude E5450",
"Windows7": null,
"Windows10": "Dell_Latitude_E5450_A08.CAB",
"WindowsServer2016": null,
"WindowsServer2019": null
}
## Information on your n8n setup
- **n8n version:** 0.169.0
- **Database you're using (default: SQLite):** SQLite
- **Running n8n with the execution process [own(default), main]:** own
- **Running n8n via [Docker, npm, n8n.cloud, desktop app]:** truenas jail