cancel
Showing results for 
Search instead for 
Did you mean: 

How to divide array into json with headers

mjain
New Contributor

Hi , I need a help I am getting data in the array format and I have to create it in the json format to dump it in CSV file

1 ACCEPTED SOLUTION

Hi @mjain

Here’s a pipeline in which the elements in the nested array are transformed into JSON documents that can be consumed by a CSV Formatter Snap.
Array_to_CSV_2020_07_03.slp (7.2 KB)

Hope it helps.

BR,
Dimitri

View solution in original post

4 REPLIES 4

dimitri_hristov
Contributor

Hi @mjain,

Maybe you could try and use the JSON Splitter Snap to split the array into separate JSON documents.

BR,
Dimitri

Hi Dimitri thanks for the quick reply I am attacting the screenshot can you please look into this. I have also tried json splitter but it is not working And the file header shoud be first array.

Capture1

I am expecting in
Capture2

Hi @mjain

Here’s a pipeline in which the elements in the nested array are transformed into JSON documents that can be consumed by a CSV Formatter Snap.
Array_to_CSV_2020_07_03.slp (7.2 KB)

Hope it helps.

BR,
Dimitri

Thank you so much. It worked.