How to simply complex structure into simple structure using ADF DataFlow reading JSON source file

Abhijit Bhadra 91 Reputation points
2022-05-31T11:12:54.48+00:00

I have JSON data source which need to be transformed into CSV structure and store into a blob storage.
207111-image.png

I have below structure as of now
ReleaseCod
[{"PCod":"P-","ActualDate":"2021-12-03","PlannedDate":null,"ReminderDate":null,"ActualBy":"LIWA"},
{"PCod":"R-","ActualDate":"2021-12-30","PlannedDate":null,"ReminderDate":null,"ActualBy":"LIWA"}]

Required structure as below
PCod ActualDate
P- 2021-12-03
R- 2021-12-30
Few things need to mention here not able to use flatten transformation as ReleaseCod having some complex structure and as well as non complex structure in same file.
So any way to achieve above mentioned structure as CSV output file?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MarkKromer-MSFT 5,226 Reputation points Microsoft Employee Moderator
    2022-05-31T19:33:47.127+00:00

    First use the Flatten transformation to unroll your top-level array. Then you'll end up with just a hierarchical structure: {"PCod":"P-","ActualDate":"2021-12-03","PlannedDate":null,"ReminderDate":null,"ActualBy":"LIWA"}.

    Now you can use a Derived Column to define new columns, i.e. "PCod", "ActualDate", ...


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.