โ12-15-2017 04:59 AM
Hi All,
I am working on generating a JSON file from a Redshift table in the below desired format
Required Output:
{
โdataโ: [
{
โclassification_codeโ: โARGENTINAโ,
โreporting_countryโ: โArgentinaโ,
โsub_regionโ: โRest of Latin Americaโ,
โterritoryโ: โLAโ,
โglobal_regionโ: โAmericasโ,
โworldwideโ: โWorldwideโ,
โpos_customer_idโ: 8,
โpos_customer_site_idโ: 13
}
]
}
But My original Output is like the below from Snaplogic
{
โclassification_codeโ: โARGENTINAโ,
โreporting_countryโ: โArgentinaโ,
โsub_regionโ: โRest of Latin Americaโ,
โterritoryโ: โLAโ,
โglobal_regionโ: โAmericasโ,
โworldwideโ: โWorldwideโ,
โpos_customer_idโ: 8,
โpos_customer_site_idโ: 13
}
Can any one guide me to get the Required output ( I need the Data Tag to be hard coded, as it is required for the UI development )
Thanks,
Aravind
โ12-15-2017 09:22 AM
This can be achieved simply using a Mapper snap and applying the mapping from $ to $data:
Does this achieve what youโd like?
โ12-15-2017 04:12 PM
Thanks @cstewart
I donโt want the data to be repeated, i followed the steps you said and got the output as like the above screenshot.
Please suggest a way to get data like
{
โdataโ: [
{
โclassification_codeโ: โARGENTINAโ,
โreporting_countryโ: โArgentinaโ,
โsub_regionโ: โRest of Latin Americaโ,
โterritoryโ: โLAโ,
โglobal_regionโ: โAmericasโ,
โworldwideโ: โWorldwideโ,
โpos_customer_idโ: 8,
โpos_customer_site_idโ: 13
},
{
โclassification_codeโ: โARGENTINAโ,
โreporting_countryโ: โArgentinaโ,
โsub_regionโ: โRest of Latin Americaโ,
โterritoryโ: โLAโ,
โglobal_regionโ: โAmericasโ,
โworldwideโ: โWorldwideโ,
โpos_customer_idโ: 9,
โpos_customer_site_idโ: 15
},
{
โclassification_codeโ: โARGENTINAโ,
โreporting_countryโ: โArgentinaโ,
โsub_regionโ: โRest of Latin Americaโ,
โterritoryโ: โLAโ,
โglobal_regionโ: โAmericasโ,
โworldwideโ: โWorldwideโ,
โpos_customer_idโ: 10,
โpos_customer_site_idโ: 15
}
]
}
โ12-15-2017 04:16 PM
This is what, I did in JSON generator, PFB screenshot
โ12-15-2017 04:17 PM
Below is my pipeline