I am trying to merge new data into an existing JSON object. My item outputs generate the same JSON structure with just different lists I am trying to append to an existing list (Item 1 in a merge?)
I haven’t been able to find an obvious way to append this. I have tried all variations of merge with no luck. Can anyone suggest something?
Hmm, I was afraid that might be the case. The object has a variable number of these arrays (from 1 to 7). I was hoping I avoid building too much dupe functionality.
Can you tell me more about your workflow? At the moment you have 2 nodes which both output some json object. if you say the number of the arrays is varaible. How do you get the input data?
I simplified the example since I assumed whatever I learned here I could use if additional arrays were in place.
The example shows questions [1,2,3] and [4,5,6]. The goal would be to have them combined into [1,2,3,4,5,6].
In theory an additional array might be newArray= [object 1, object 2, object 3] and [object 4, object 5, object 6], so the goal would be to also combine those as seen above.
to merge objects they need to have different name. In this case we need to check where the data gets changed within the objects. In your case I split out the questions and then merged it and then append it to the input json structure. Maybe this does help you.