cancel
Showing results for 
Search instead for 
Did you mean: 

Join 2 arrays

Sahil
Contributor

I have 2 different arrays, one having id, header and another having id,name.
Need to join these 2 arrays and get an output file of id,header,name.
I need json splitter json path, I have just for id which is jsonPath($, “id[*]”).
How do I include both id and header.
File.txt (4.2 KB)

1 ACCEPTED SOLUTION

bojanvelevski
Valued Contributor

try different mapping, change the ‘$’ to something else

View solution in original post

15 REPLIES 15

bojanvelevski
Valued Contributor

I checked your sample, but it’s not as nearly flat as you described it. I’ll need some time to do further analysis

bojanvelevski
Valued Contributor

You need to do multiple splitting and mapping. Check the pipeline below, just upload your xml file, validate and let me know if it’s ok.

Join 2 arrays_2022_04_18.slp (18.4 KB)

Hi,Thank you for the pipeline.

There are 2 issues in the pipeline:-

  1. If we use
    jsonPath($, “$ContentObjectProperty[*][‘$’]”).filter(x=>x!='feature ')
    it picks all the content even from shortText and longText. We need to pick only Name.
    2)I see an error at JSON Splitter3
    Failure: Json Splitter expects a list, Reason: Found an object of type class java.util.LinkedHashMap, Resolution: The path $.ObjectRef needs to refer to a list in the incoming document

bojanvelevski
Valued Contributor

I used the file you sent, so if you’re using a different file, try to adjust the pipeline to work with that one, or send the file so I can try and do the modifications

Hi, I made few changes but still these two changes, I am not able to solve. Appreciate your help!
File is attached.
file2.txt (5.0 KB)