ADF - XML Flatten I can't unroll root

Jay 556 Reputation points
2020-10-19T08:28:45.75+00:00

33254-samplefile.xml

I thought I'd have a looked at the new XML import in ADF but I'm stuck trying to flatten the data.
I have attached an xml sample file I'm using.

The import looks to have worked OK as I can see the data
33255-image1.png
33303-image2.png

But when I try and flatten it is all greyed out and I can't select a root anything, what have I missed?

33210-image3.png

Here's the JSON if it helps

{
"name": "dataflow2",
"properties": {
"type": "MappingDataFlow",
"typeProperties": {
"sources": [
{
"linkedService": {
"referenceName": "AzureBlobStorage1",
"type": "LinkedServiceReference"
},
"name": "source1"
}
],
"sinks": [],
"transformations": [
{
"name": "Flatten1"
}
],
"script": "source(output(\n\t\tCUSTOMERS as (CUSTOMER as ({@CREATED_DATE} as string, {@GROUP_ID} as string, {@ID} as integer, ADDRESS as (ADDRESS_LINE_1 as string, ADDRESS_LINE_2 as string, ADDRESS_LINE_3 as string, COUNTRY as string, COUNTY as string, POSTCODE as string, TOWNCITY as string), ATTRIBUTE as ({@DeezNutz } as string, {value} as boolean), CONTACT_DETAILS as (EMAIL as ({@Mar Com DG _OPT_IN} as boolean, {value} as string), TELEPHONE as ({@Mar Com DG _OPT_IN} as boolean, {@type } as string, {value} as integer)), DATE_OF_BIRTH as string, GENDER as string, NAME as (FIRST_NAME as string, LAST_NAME as string, TITLE as string), NOTE as string))\n\t),\n\tallowSchemaDrift: true,\n\tvalidateSchema: false,\n\tignoreNoFilesFound: false,\n\tformat: 'xml',\n\tcontainer: 'test-xml',\n\tfileName: 'SampleFile.xml',\n\tvalidationMode: 'none',\n\tnamespaces: true,\n\tpartitionBy('hash', 1)) ~> source1\nsource1 foldDown(mapColumn(\n\t\tCUSTOMERS\n\t),\n\tskipDuplicateMapInputs: false,\n\tskipDuplicateMapOutputs: false) ~> Flatten1"
}
}
}

Thanks,
Jay

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

Accepted answer
  1. HimanshuSinha-msft 19,381 Reputation points Microsoft Employee
    2020-10-19T23:20:37.74+00:00

    Hello @Jay ,

    Thanks for the ask and also using the Microsoft Q&A.

    On the screen where we have the "i" which says 'Choose the array in your data to flatten" . In the XML whch you shared you do not have an
    array . I just copied the Customer under Customers , and now we have two two customer and things started working on the UI .
    I am sharing the XML , hope this helps .

    Thanks Himanshu
    Please do consider to click on "Accept Answer" and "Up-vote" on the post that helps you, as it can be beneficial to other community members

    33425-xmlissue.gif33386-xml.xml

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful