Forum Discussion

Aravind711's avatar
Aravind711
New Contributor II
8 years ago

Json File generation from Redshift Table

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

5 Replies

  • Akshita's avatar
    Akshita
    New Contributor

    Hi @ForbinCSD,

    Thank you for the response.

    Source and target are two different input files and both are in csv format. I am attaching a sample scenario for further understanding.
    In the screenshot attached - input1 is the source file which will contain column headers and data. Input 2 is the target file which will contain only column headers.
    Output is the format we require.
    Basically input2 is the output format, we need data from input1 in input2 file for respective matched columns.
    columns.

    • vaidyarm's avatar
      vaidyarm
      Contributor

      try to read the source data and the output file first and then use join snap(probably merge), filter the null columns(those which are not present in both) then you can perform mapping the required fields.

      Thanks