Use FetchXml to filter a CRM List?

How to use FetchXml to filter a CRM List when synchronising Dynamics CRM

Often when you are conducting a synchronisation or migration of data you only want to concentrate on a subset of the data. I the case of Dynamics CRM Online or 2011 Data Synchronisation Studio allows you to specify a filter using the standard FetchXml syntax.


A great way to get the correct fetch xml is to create an advanced find and then click the 'Download Fetch XML' button. This downloads a txt file with the complete xml in it. Copy the filter node and paste into the fetch XML fields in Data Sync.

example 1:

<filter type="and">
<condition attribute="statecode" operator="eq" value="6" />

example 2:

<filter type="and">
<condition attribute='importsequencenumber' operator='eq' value='1' />


It is important to note that we are including the 'filter' clause in Fetchxml statement. Other operators are available:

<filter type='or'>
<condition attribute = 'createdon' operator='today'/>

More examples of the FetchXml syntax can be found on the Microsoft Site.

Can't find the answers you're looking for? Contact our support team and we'll personally get back to you as quickly as we can.