how can i parse a nested json file in Azure Data Factory?

Viewed 1111

I have multiple json files in datalake which look like below:

enter image description here

The complex type also have arrays embedded in it.

How can i flatten this json to csv file by either using copy activity or mapping data flows ?

Thanks

3 Answers

To flatten arrays, use the Flatten transformation and unroll each array.

As your source Json data contains multiple arrays, you need to specify the document form under Json Setting as 'Array of documents' enter image description here

Then, use flatten transformation and inside the flatten settings, provide 'MasterInfoList' in unrollBy option.Use another flatten transformation to unroll 'links' array to flatten it something like this.

enter image description here

First check JSON is formatted well using this online JSON formatter and validator.

If source json is properly formatted and still you are facing this issue, then make sure you choose the right Document Form (SingleDocument or ArrayOfDocuments).

Also refer this Stackoverflow answer by Mohana B C

Related