โ11-09-2022 10:48 AM
Hi there, I have input of a snap coming in as
but want to have it as and โorder-lineโ renamed as โorder-linesโ
Basically grouping the โdataโ segment.
I have tried Join, Group by Field, Mapper snaps but nothing worked. surely I am not doing right.
Any pointers on how to achieve it?
Thanks
Manohar
jsoninput.json (106.8 KB)
โ11-09-2022 10:46 PM
Hi @manohar ,
How I see it when I use the json file, There are two same โdataโ objects. One with only orderline and one with the other objects inside so that means that some โdataโ objects contain the orderline and some does not.
When i try to extend the โdataโ object with the orderline and rename it. Only the second data object gets the new orderlines object because that โdataโ object only contains the Order-line the other Data object just gets a โnullโ value in the orderlines object field.
I donโt know where you get your data from but it seems that not every data object has the order-line.
pipeline below for more explanation
community_pipeline_V1.0_2022_11_10.slp (124.9 KB)
โ11-10-2022 04:11 AM
Hi @JensDeveloper appreciate your help.
In fact, the orderline is not coming in the โdataโ object. I just transformed it as below to have it part of the data thinking it might help, like using join as below
โdataโ with out orderlines is coming from different snap and orderlines are coming from different snap
please find attached the input jsons and the json that I am trying to achive as final.
Thank you for you help,
Manohar
input_json2_with_orderlines.json (82.4 KB)
input_json1_with_outorderlines.json (23.2 KB)
Final_Expected_Json_structure.json (2.4 KB)
โ11-10-2022 04:26 AM
Hey @manohar,
Try the following pipeline. Keep in mind that this will work if you only have these 2 incoming objects.
Structuring Data_2022_11_10.slp (126.1 KB)
โ11-10-2022 10:22 PM
Hi @bojanvelevski , your solution works like charmโฆ
thereโs one issue though. After the Structure Snap, I get Order lines in its original format, as in the right box in below screenshot. but I need the output shown in the left box.
Example -
In
โidโ: {
โ@typeโ: โintegerโ,
โ$โ: โ40114โ
},
needs to be transformed to as
โidโ: โ40114โ,
Alos, donโt need some of the nodes like โaccounting-totalโ, โcreated-atโ.
Then there are some like which needs to be mapped as it is
โline-numโ: โ00010โ, to โline-numโ: โ00010โ,
I have tried using another structure, and mapper snaps and they come out as below
Any direction in this case?
Thanks
Manohar