I would receive JSON in various formats and hierarchies, Need to know the possibility to be able to convert any JSON format into CSV by forming columns dynamically.As an example,i have provided the required details,below is an multi level JSON and the expected CSV output
JSON
{
"getUsers":[
{
"UserInformation":{
"Id":1111122,
"firstName":"*****1",
"UserType":{
"name":"CP"
},
"primaryState":"MA",
"otherState":[
"MA",
"BA"
],
"createdAt":null
}
},
{
"UserInformation":{
"Id":3333,
"firstName":"*****3",
"UserType":{
"name":"CPP"
},
"primaryState":"MPA",
"otherState":[
"KL",
"TN"
],
"createdAt":null
}
}
]
}
Here is how you can do it using Cinchoo ETL programatically.
First construct configuration object, along with fields configurations at runtime and pass it to reader for loading JSON
Fiddle: https://dotnetfiddle.net/Gfw3r7