โ10-09-2018 09:05 AM
Hello, Below is the JSON output from a REST API source. I am trying to flatten the hierarchical JSON structure using the splitter snap. I am able to flatten โmealsโ attribute, but unable to split the โcredentialsโ. The expected output should be all the attributes should be column names.
{
โobjectโ: โlistโ,
โdataโ: [
{
โidโ: โlocidโ,
โobjectโ: โlocnameโ,
โgroup_idโ: โgrp_idโ,
โnameโ: โname1โ,
โactiveโ: 1,
โcountโ: 2,
โtimezoneโ: โxxxxโ,
โweek_endโ: โWednesdayโ,
โsales_taxโ: 0.0825,
โschedule_startโ: โโ,
โschedule_stopโ: โโ,
โtypeโ: โxxxxโ,
โmealsโ: [
{
โnameโ: โbreakfastโ,
โendโ: โ10:30โ
},
{
โnameโ: โlunchโ,
โendโ: โ15:00โ
}
],
โcredentialsโ: {
โstr_idโ: โ999999โ,
โstr_id_2โ: โ2222โ
}
}
Solved! Go to Solution.
โ10-16-2018 02:46 PM
Youโll need to add some element to the meal list when itโs empty in order to get the splitter to do anything. Maybe add an empty object (i.e. {}
) or null
.
โ10-12-2018 10:01 AM
The attached example is able to flatten the Credentials attribute. But If you see the output results, It is not bringing any data for the 2nd document (ie Loc_2), since it does not have any meal information
โ10-16-2018 02:46 PM
Youโll need to add some element to the meal list when itโs empty in order to get the splitter to do anything. Maybe add an empty object (i.e. {}
) or null
.
โ10-17-2018 10:36 AM
That Worked. Thank You.
โ10-09-2018 10:02 AM
Can you export and attach the pipeline that you have so far so that we can see the configuration of the splitter snap?
โ10-09-2018 10:52 AM
Splitjsonobject.slp (13.8 KB)
Uploaded the Pipeline file โsplitjsonobject.slpโ