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:
- Through the connection window.
- Drag and drop from the connection tree view.
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'.
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.
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.
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" /> </filter> </entity> </fetch>
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.
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.
Compare A to B and then synchronise. This will synchronise the extracted data from the FetchXML into the CSV file.
Dynamics 365 authentication provider scheme to use.
URL to your Dynamics 365 Organisation Service SOAP\WCF service.
DataTime handling: Utc or local.
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.