Merge multiples items into 1 array

Hello Community

I would like your help to solve the merge of multiple items to one array

Describe the issue/error/question

I have 3 projects with two sources of informations for each
represented by Set(x) and Set(x)a

I have used the merge node with merged by index for (#projectx) node
It merged the two set for each project into one set with merged by index
Status => working

I have used the merge node with append for (merge1) node
it append the two projects arrays in one project array
Status => working

What is the error message (if any)?

I have used the merge node with append
it append the first previous object of the project array (Merge1) and the project array of the second merge node (Projetct3)
Status => Failed

I have used the merge node with merged by index with whatever joins
the result is only one previous merge node
Status => Failed

1/ Is there a way to get all combined into one array ?
2/ Better is there a Javascript or Json code node that can combine all 3 arrays into one ?

Please share the workflow

Thank You

Information on your n8n setup

  • **n8n version:Desktop Version 0.209.4
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • **Running n8n via [Docker, npm, n8n.cloud, desktop app]:Desktop

Hi @terryble66, I am afraid I don’t think I fully understand what exactly is failing here.

Your workflow ran fine for me when testing this:

That’s on both the current release version of n8n (0.212.0) and the desktop version. Can you confirm which problem exactly you are seeing?

Thank you!

Hello @MutedJam
When I ran the workflow in merge1 i have this result :


[
{
"id":
"id1",
"project":
"project1",
"name":
"name1",
"week":
"week1"
},
{
"id":
"id2",
"project":
"project2",
"name":
"name2",
"week":
"week2"
}
]

and when the merge2 ran , I have this result below , I have lost the object2


[
{
"id":
"id3",
"project":
"project3",
"name":
"name3",
"week":
"week3"
},
{
"id":
"id1",
"project":
"project1",
"name":
"name1",
"week":
"week1"
}
]

Is there a way in javascript to combined all in one function node ? that will make it easier if i have several project objects to merge ?

Thank you

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.