Hi Upendra Singh ,
Welcome to Microsoft Q&A platform and thanks for posting your query here.
As I understand your query, you are trying to convert the json data into csv format with the help of mapping dataflow in ADF pipeline. Please let me know if that is not the requirement.
This can be achieved by creating two branches (one having only employee and bank, other having only employee and dependent) and then flatten the data of bank[] array and dependent[] array in each of the branches, do a full-outer join based on surrogate key and then use select transformation to deselect the unnecessary columns .
- Add the Source transformation to point to the input json dataset. Select JSON Document form as 'Array of documents'
- Add Flatten transformation and select bankdetail[] to unroll by and in source columns select 'employee' as 'employee' and 'bankdetail.banknumber' as 'bank'
- Create a new branch out of the source transformation and add another flatten transformation and select 'dependent[]' to unroll by and in source columns select 'employee' as 'employee' and 'dependent.depname' as 'dependent'
- Add Surrogate key transformation to create unique ID associated with each of the rows in both the branches and give the column name as 'Id1' and 'Id2' respectively
- Add Join transformation and select 'Full outer' join to join using Id1==Id2
- Use Select transformation to deselect all the columns except employee, bank and dependent
Sharing the implementation videos below:
Part1:
Part2:
Hope it helps. Please let us know if you have any additional queries. Kindly accept the answer by clicking on Accept answer
button. Thankyou