09-30-2020 02:06 AM
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:
Like
“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)
09-30-2020 03:52 AM
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.
Regards,
Spiro Taleski
09-30-2020 07:00 AM
Hi Spiro,
This works.
Thanks a lot for your help.
Regards,
Parin Shah