Dynamic 365 Fetch xml retrieve attributes in a specified order

Vs2021 46 Reputation points
2021-08-12T16:21:51.093+00:00

I am connecting to dynamic 365 via azure data factory and extract it as csv file . Is there a way for fetch xml to retrieve the attributes in the same order using the below xml

<fetch>

<entity name="incident">

<attribute name="title" />

<attribute name="incidentid" />

<attribute name="t_subsidiaryid" />

</entity>
</fetch>

What should I do to order the output of csv file in the below order :

Title
Incidentid
t_subsidiaryid

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,199 questions
{count} vote

1 answer

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,061 Reputation points
    2021-08-13T21:42:17.203+00:00

    Hello @Vs2021 and welcome to Microsoft Q&A. I am not an XML expert but I have a solution.

    From my understanding, if such limitation is possible it would be in the fetchxml specifications and not specific to Data Factory.

    However I think a much easier solution would be to re-order the columns during the mapping portion of the Copy Activity.

    If your sink dataset does not have any schema defined, then you can specify the column order during the mapping portion. See below GIF where I just finish importing schemas where the source schema is defined in dataset, but sink dataset has no schema defined. I drag the order of the mapping.

    123222-mappingorder.gif