1

I have the below JSON file.

object{2}
    columns[5]
    0{3}
        name    :   EmpNo
        fieldId 67
        type    :   text
    1{3}
        name    :   datetime
        fieldId 564
        type    :   datetime
    2{3}
        name    :   analytics
        fieldId 56
        type    :   text
    3{3}
        name    :   category
        fieldId 45
        type    :   text
    4{3}
        name    :   code
        fieldId 12
        type    :   text
rows[456]
    0[5]
      0:13
      1:8/7/2021 1:06:13 AM
      2:demo
      3:demo/1
      4:spee-analytics
    1[5]
      0:23
      1:1/24/2022 8:30:28 AM
      2:speed
      3:win
      4:check-123



I am trying to convert the above JSON into a CSV file using Azure Data Flow and expecting the below result.

enter image description here

I am trying to use data flow but no success. I tried to refer other posts but didn't get any result

enter image description here

Can anyone advise how to convert the above JSON into csv?

sthambi
  • 197
  • 2
  • 17
  • can you share correct format of Json file. with this file in data factory, it is showing Check if the data is in valid JSON object format. – Pratik Lad Jul 29 '22 at 11:56
  • @PratikLad-MT, this is correct JSON. I just converted into dummy data – sthambi Jul 29 '22 at 12:45
  • Please check my answer to the similar problem here: https://stackoverflow.com/questions/72100860/adf-dataflow-and-columns-rows-in-separate-array-in-json/72783837#72783837 – Sally Dabbah Aug 01 '22 at 09:12

1 Answers1

0

you can directly use data flow for this. First transform json to json to get nested columns flatten. Then use copy activity to copy result json to csv.

My source json:

enter image description here

Flatten transformation:

enter image description here

Sink JSON Mapping:

enter image description here

Now you will get result json use copy activity to convert it to csv:

enter image description here

Result csv:

enter image description here

B. B. Naga Sai Vamsi
  • 2,386
  • 2
  • 3
  • 11