06-22-2022 01:53 AM
Hi Snaplogic experts,
i would like to ask you if there is chance to create from Json like this:
{
"CompanyName": "TestCompany",
"CompanyAddress": "TestAddress",
"CarDetails": [
{"Brand": "BMW", "Year": "2020", "Fuel": "Petrol"},
{"Brand": "Jaguar", "Year": "2020", "Fuel": "Diesel"},
{"Brand": "GMC", "Year": "2019", "Fuel": "Petrol"}
]
}
three jsons like this:
{
"CompanyName": "TestCompany",
"CompanyAddress": "TestAddress",
"Brand": "BMW",
"Year": "2020",
"Fuel": "Petrol"
}
,
{
"CompanyName": "TestCompany",
"CompanyAddress": "TestAddress",
"Brand": "Jaguar",
"Year": "2020",
"Fuel": "Diesel"
}
it means “CompanyName”: “TestCompany” and “CompanyAddress”: “TestAddress” will be something like header for all jsons and Car details will be added to them. If yes, how to do it ? do i need separate route in order to get ‘header’ and second for Car details and then concat them somehow? do i need to use child pipeline as for each action? thank you
Solved! Go to Solution.
06-22-2022 02:03 AM
Hi @SL12345,
Just use a JSON Splitter and split on $CarDetails
array, but make sure you have enabled “Include scalar parents” option in the JSON Splitter.
Result:
06-23-2022 12:11 AM
Hi @SL12345 ,
you can put a mapper snap next to it with this configuration. It will give Cars to every object.