Extract data from Json to CSV File

Hi All,

I have a JSON file and i am trying to extract specific data and copy it in a csv file.

The sample structure is given below and from this structure i want to extract only the value part from each attribute:
“value”: “B12345678”
“value”: “Test”
in the CSV file.

Sample Structure:

“uri”: “entities/Uar9IVr”,
“createdTime”: 1579160841170,
“updatedTime”: 1579694894814,
“attributes”: {
“HCOID”: [
“type”: “configuration/entityTypes/HCO/attributes/HCOID”,
“ov”: true,
“value”: “B12345678”,
“uri”: “entities/Uar9IVr/attributes/HCOID/1OAQhar5j”
“Name”: [
“type”: “configuration/entityTypes/HCO/attributes/Name”,
“ov”: true,
“value”: “Test”,
“uri”: “entities/Uar9IVr/attributes/Name/1OAQZvp6V”

I am also attaching the entire structure for better understanding of the structure.

Can anyone help me with a sample snap solution for this kind of structure.

FlattenJson.txt (6.1 KB)

Hi @Parin,

Please take a look at the attached sample pipeline:

SL_Community_Pipe_2020_09_30.slp (11.3 KB)

I am simply map the “value” field from each attribute and convert it to a String.

Let me know if this works for you.

Spiro Taleski

1 Like

Hi Spiro,

This works.

Thanks a lot for your help.

Parin Shah