โ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