Extracting Dynamics 365 data using Azure Data Factory pipeline with FetchXML query

369 views Asked by At

I want to use FetchXML query to extract data from Dynamics 365 in Azure Data Factory.

I used this initial setup for the entity 'campaignactivity' (without any FetchXML query): enter image description here

And in preview data I see columns like actualstart: enter image description here

But when I tried using FetchXML query, I got this error: enter image description here

This is the FetchXML query I am using: enter image description here

I tried testing it with only one attribute but I only get the primary key as output: enter image description here enter image description here

I tried this pipeline with other entities too. Some of them don't produce any error but it also has fewer columns than not using FetchXML query.

1

There are 1 answers

0
Juan Camilo Echeverry On

Maybe there's some issue parsing the text you gave. I've got it to work using single quotes or text functions like @concat().

This is a fetch that i use for the contact entity for example:

concat('<fetch><entity name="contact"><filter type="and"><condition attribute="contactid" operator="eq" value="{', $DataverseFhirId,'}"/></filter></entity></fetch>')

And here is another without @concat, make sure to use single quotes:

'<fetch><entity name="contact"><attribute name="parentcustomerid" /><attribute name="drh_patientfhirid" /></entity></fetch>'

Also, for some reason if you dont specify any attributes, it fetches the whole entity.