Microsoft Dynamics 365 FetchXML


Data Synchronisation Studio (Data Sync) contains the Microsoft Dynamics 365 FetchXML provider which connects to an instance of Dynamics CRM 2011, 2013 and newer or Dynamics 365 Online. There are two ways to connect to the FetchXML provider:

  1. Through the connection window.
  2. Drag and drop from the connection tree view.

Connection Window

Select the FetchXML provider, this will automatically populate fields based upon any previously saved Dynamics CRM connection. Enter in the FetchXML into the FetchXML property in the dialog box and then press 'Connect'.

Connecting with FetchXML

Connection Tree

The preferred way to connect to Dynamics 365 is to drag and drop the FetchXML entity from the connections tree onto the data source, and enter the FetchXML into the properties field.

Connection Tree Connection

Using FetchXML

Data Sync can be used to extract data from a CRM advanced find or view using the FetchXML provider.

Exporting the FetchXML from an Advanced Find Query

Create an advanced find query in Dynamics CRM and export the xml by selecting the 'Download Fetch XML'button.

Dynamics CRM Advanced Find

Open the downloaded file in notepad and copy the xml. This will be used by Data Sync to extract data from Dynamics CRM through the FetchXML connector.

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
  <entity name="contact">
    <attribute name="fullname" />
    <attribute name="contactid" />
    <attribute name="websiteurl" />
    <attribute name="emailaddress1" />
    <order attribute="fullname" descending="false" />
    <filter type="and">
      <condition attribute="websiteurl" operator="not-null" />

In the above example the filter clause has been used, for other examples of the FetchXML syntax please follow the link to the Microsoft web page.

Add the FetchXML to the Project

Connect to the FetchXML connector following the previous instructions and paste the desired xml into the FetchXML field.

Preview the Data

To preview the data press 'Preview A' in the schema map tab.

Schema Map

Export to CSV

To export the data into a CSV file the 'Create CSV File' feature can be used which is located in the tools menu. You will need to set the new CSV files location.

Create CSV File

Compare A to B and then synchronise. This will synchronise the extracted data from the FetchXML into the CSV file.

The project can then be saved and scheduled to extract daily, hourly or weekly using the Run Tool and/or Ouvvi, or the project can be run Ad-Hoc.



Dynamics 365 authentication provider scheme to use.


URL to your Dynamics 365 Organisation Service SOAP\WCF service.


DataTime handling: Utc or local.


FetchXML query.


Number of records to return in each request, maximum 5000.


Name of a saved query in CRM. Overrides the FetchXML option.


Service HTTP Request Timeout.