ADF Mapping Issue (NOT Mapping Data Flows) - (another urgent issue)

Mike Kiser 1,531 Reputation points
2021-03-13T20:46:08.873+00:00

Hello! @Nasreen Akter @MartinJaffer-MSFT @HimanshuSinha-msft

We have a major issue in QA Testing before we can go live; we have the following in a json data file that I am using the COPY to copy the data into a SQL Server Table. Please see the following: It was just noticed that the ADF is copying only the first item in the array below and that is all to the first row in the DB Table (see screenshot below). How can I map in ADF (we DON"T have Mapping Data Flows in the Govt Cloud yet) the following so that I can copy all 3 of these phone number types into the DB Table?
Thanks
MIke

"contactInformation": {
"phoneNumbers": [
{
"isPrimary": true,
"type": "Business",
"phoneNumber": "215/483-1234"
},
{
"isPrimary": false,
"type": "Business Cellular",
"phoneNumber": "541/281-6984"
},
{
"isPrimary": false,
"type": "Home",
"phoneNumber": "979-256-9666"
}
],

77428-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,487 questions
0 comments No comments
{count} votes

Accepted answer
  1. Nasreen Akter 10,736 Reputation points
    2021-03-14T01:08:36.49+00:00

    Hi @Mike Kiser ,

    There is an option in the CopyActivity --> Collection reference. Please select phoneNumbers [] array on the dropdown. Hope this will work for you! Thanks! :)

    77417-img22.jpg


2 additional answers

Sort by: Most helpful
  1. MadhaviB 76 Reputation points
    2021-03-14T00:29:31.41+00:00

    It depends on how you are parsing Json data in source data set of your pipeline. For above json data , please try with source data set query as below and then map to SQL Server table as target data set.

    Select
    ci.isPrimary
    ,ci.type
    ,ci.phoneNumber
    from c
    JOIN ci IN c.contactInformation.phoneNumbers

    77437-image.png

    0 comments No comments

  2. MadhaviB 76 Reputation points
    2021-03-14T03:23:37.61+00:00

    If Json is from storage account, Map the collection reference in Copy Activity.

    77453-image.png