xml file returns only first row

OoBiDev 20 Reputation points
2023-08-29T07:06:59.54+00:00

Hello

I am trying to transfer files from xml file (http request) to sql server,

the problem is that it returns only the first row.
for example:
for each row i got only the first parameter.

observation tag and station tag works fine, but parameter tag returns only the first row.

this is my mapping: (i dont need the Originator tag)
ParameterShortName: ['Parameter'][0]['ParameterShortName']

ParameterValue:['Parameter'][0]['ParameterValue']
I tried to change the [0] to [1] and it returns the second row, how can i get all the rows?
Thank you.User's image

User's image

User's image

User's image

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

Accepted answer
  1. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2023-08-30T22:24:06.56+00:00

    @OoBiDev Welcome to Microsoft Q&A forum and thanks for reaching out here.

    As your HTTP source returns XML format data, you cannot use REST connector in ADF to read the data as it expects the API response to be JSON format. Hence the only available option is to:

    1. Use HTTP connector in Copy activity source and copy the XML data as a file to interim staging Azure Blob storage or a Azure Data Lake Gen2 folder.
    2. Then use a mapping data flow activity in your ADF pipeline and point the mapping data flow source to the XML file that you downloaded/copied using previous copy activity.
    3. Next as @Subashri Vasdudevan mentioned use a flatten transformation in data flow to flatten the nested array XML
    4. Then finally use a sink transformation to copy the data to your Azure SQL server.

    As your XML has a complex structure and needs multiple flattening, copy activity is not suitable here.

    Hope this info helps. Do let me know how it goes.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.


1 additional answer

Sort by: Most helpful
  1. Subashri Vasudevan 11,226 Reputation points
    2023-08-29T08:04:21.65+00:00

    Hi @OoBiDev Thanks for your question and using MS q&a portal.

    Please try to use just the property names like below instead of indexing the properties

    ['ParameterShortName'] ['parametervalue']

    Please try and let us know.

    Thanks


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.