JSON Nested Array data as String value

Kunal Kumar Sinha 171 Reputation points
2020-12-04T14:14:16.367+00:00

Hi,

I'm trying to fetch data from API and store it in Azure Sql, the api response has nested array data (PFA sample file) I need to capture all the nested records under result node. I tried using map complex values to string option in mapping section of copy data activity but it's not returning the entire array as string value so that i can use sql script to parse it. Please provide some solution to this.

45198-image.png

Thanks,
Kunal

45199-responsefile-783-15174-page-1.txt

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

Accepted answer
  1. Kunal Kumar Sinha 171 Reputation points
    2020-12-18T06:10:33.943+00:00

    Hi @HimanshuSinha-msft ,

    I used Advanced editor section in mapping field to capture the entire array field using wildcard '*'.

    Thanks,
    Kunal

    49392-capture.png

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,236 Reputation points
    2020-12-08T22:12:58.98+00:00

    Thank you for the sample data @Kunal Kumar Sinha .

    The preferred way to handle this type of deeply nested JSON is a 2-step process.

    First, capture the $.results , copying from the REST api to either blob storage or ADLS gen2.

    Second, load the stored data using Mapping Data Flow. In the Data Flow we can use the Flatten/Unroll transformation to break the data out into a tabular format as desired before pushing to Azure Sql.

    The first step is necessary because (last I checked) Mapping Data Flow cannot load directly from REST.

    Before I go deeper, do you have any objection to using Mapping Data Flows?


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.