cancel
Showing results for 
Search instead for 
Did you mean: 

Help to parse Json data into csv

deeps
New Contributor III

I need help to parse this data into csv format 

[
{
"id": "12345",
"email": "mary@xyz.com",
"status": "active",
"groups": [
"Software","Hardware"
],
"username": "r1234",
"domain": "xyz.com",
"orgSpecific": true,
"firstName": "Mary",
"lastName": "R",
"countryCode": "US",
"userType": "ID"
},
{
"id": "1234",
"email": "maxie@xyz.com",
"status": "active",
"groups": [
"Software","Hardware","Internal","External"
],
"username": "r124",
"domain": "xyz.com",
"orgSpecific": true,
"firstName": "Maxie",
"lastName": "R",
"countryCode": "US",
"userType": "ID"
},
{
"id": "123456",
"email": "freshman@xyz.com",
"status": "active",
"username": "F1234",
"domain": "xyz.com",
"orgSpecific": true,
"firstName": "Freshman",
"lastName": "F",
"countryCode": "US",
"userType": "ID"
}
]

I tried Autoprep , Json splitter snap but no luck.  

1 ACCEPTED SOLUTION

Aleksandar_A
Contributor III

Hello @deeps,

I'm not sure of how exactly you want your csv to be structured, but you can join the groups array to a string using .join() function in a Mapper Snap, and then you will have a flat structure that you can format as CSV.

 

Please refer to the attached pipeline, and let me know if this helps you.

Regards,

Aleksandar.

View solution in original post

3 REPLIES 3

Aleksandar_A
Contributor III

Hello @deeps,

I'm not sure of how exactly you want your csv to be structured, but you can join the groups array to a string using .join() function in a Mapper Snap, and then you will have a flat structure that you can format as CSV.

 

Please refer to the attached pipeline, and let me know if this helps you.

Regards,

Aleksandar.

deeps
New Contributor III

Thank you @Aleksandar_A , it worked. 

dmiller
Former Employee

@Aleksandar_A  AWS credit for you!


Diane Miller