Describe the problem/error/question
I’m basicially having two items which i fetch from a website using one HTTP Request and i split that Request into two HTML elements, which i want to combine at the end to a specific JSON Model into one item.
The problem here is, that i’m having two different arrays which i want to combine:
JSON of Input 1 (date):
[
{
"date":[
"21.04.2023, 19:30 Uhr",
"12.07.2023, 20:00 Uhr",
"24.06.2023",
"21.07.2023, 19:30 Uhr"
]
}
]
JSON of Input 2 (title)
[
{
"title":[
"Topic 1",
"Topic 2",
"Topic 3",
"Topic 4"
]
}
]
My target is to comine them as the following (the fetched date is not always perfect):
{
"events": [
{
"date": "21.04.2023, 19:30 Uhr",
"title": "Topic 1"
},
{
"date": "12.07.2023, 20:00 Uhr",
"title": "Topic 2"
},
{
"date": "24.06.2023",
"title": "Topic 3"
},
{
"date": "21.07.2023, 19:30 Uhr",
"title": "Topic 4"
}
]
}
I was trying with Item Lists, Merge and also Code with e.g. concat but the result is not what i’ve expected. Maybe you can help me out here
Please share your workflow
Share the output returned by the last node
[
{
"title":[
"Topic 1",
"Topic 2",
"Topic 3",
"Topic 4"
]
},
{
"date":[
"21.04.2023, 19:30 Uhr",
"12.07.2023, 20:00 Uhr",
"24.06.2023",
"21.07.2023, 19:30 Uhr"
]
}
]
Information on your n8n setup
- n8n version: 0.222.3
- Database (default: SQLite): PostgreSQL
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system: Debian 11