Hi
I have this flow (JSON - Function - SET) that It gives 1 JSON result and then I split using a function formula and “clean” using SET. I have this issue when where some values are not well split between event and bookings fields, seems some values are missing and then they overlap with wrong label. Thank you very much.
From “SET”
JSON feed
FLOW
{
"nodes": [
{
"parameters": {
"url": "http://www.trumba.com/calendars/brisbane-city-council.json",
"options": {}
},
"name": "Brisbane",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
110,
850
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "cost",
"value": "={{$json[\"customFields\"][4][\"value\"]}}"
},
{
"name": "age",
"value": "={{$json[\"customFields\"][5][\"value\"]}}"
},
{
"name": "title",
"value": "={{$json[\"title\"]}}"
},
{
"name": "location",
"value": "={{$json[\"location\"]}}"
},
{
"name": "startdatetime",
"value": "={{$json[\"startDateTime\"]}}"
},
{
"name": "enddatetime",
"value": "={{$json[\"endDateTime\"]}}"
},
{
"name": "allday",
"value": "={{$json[\"allDay\"]}}"
},
{
"name": "eventimage",
"value": "={{$json[\"eventImage\"][\"url\"]}}"
},
{
"name": "eventtype",
"value": "={{ $node[\"Split up\"].json[\"customFields\"][\"3\"][\"value\"] }}"
},
{
"name": "bookings",
"value": "={{$json[\"customFields\"][6][\"value\"]}}"
},
{
"name": "bookingrequired",
"value": "={{$json[\"customFields\"][7][\"value\"]}}"
}
],
"number": [
{
"name": "EventID",
"value": "={{$json[\"eventID\"]}}"
}
]
},
"options": {}
},
"name": "Keep Brisbane Data",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
430,
850
]
},
{
"parameters": {
"functionCode": "const newItems = [];\nfor (const item of items[0].json) {\n newItems.push({json: item});\n}\nreturn newItems;"
},
"name": "Split up",
"type": "n8n-nodes-base.function",
"position": [
270,
850
],
"typeVersion": 1
}
],
"connections": {
"Brisbane": {
"main": [
[
{
"node": "Split up",
"type": "main",
"index": 0
}
]
]
},
"Split up": {
"main": [
[
{
"node": "Keep Brisbane Data",
"type": "main",
"index": 0
}
]
]
}
}
}

