Crawling FetchXML Queries

FetchXML is a powerful tool for joining tables through relationships in 365 Dynamics. For more information, see Query data using FetchXml in the Microsoft documentation. FetchXML builder tools such as “FetchXML Builder for XrmToolBox“ can be used to help build the query relationships for use within the Dynamics Connector.

To configure your environment to use FetchXML, do the following:

  1. In Connectivity Hub, on the Connections page, create or edit an existing connection Connection defines the how Connectivity Hub connects to your Source System (which contains your documents, graphics, etc.,). Your Connection includes identifying elements such as: URL of the BA Insight web service connector you are using, (File Share connector, SharePoint Online connector, etc.), Authentication mode, User Accounts and Credentials, Database information (for database connectors) to a Dynamics connector.

  2. Click the General Settings tab.

  3. In the FetchXML Query field, enter the code snippet for your FetchXML query.

Refer to the following for FetchXML query examples:

This fetchXML entity will join the ‘account’ and ‘contact’ entities:

Copy
<entity name='account'>
  <attribute name='name'/>
  <link-entity name='contact' from='parentcustomerid' to='accountid' alias='contact' link-type='outer'>
    <attribute name='fullname'/>
  </link-entity>
</entity>

Account is the primary entity within Connectivity Hub, while Contact will be retrieved as a one-many-relationship. The fields returned are account_name and account_contact_fullname.

This FetchXML entitity uses the <all-attributes/> element to include all available attributes of both the account and contact table:

Copy
<entity name='account'>
      <all-attributes/>
      <link-entity name='contact' from='contactid' to='primarycontactid' alias='contact' link-type='outer'>
         <all-attributes/>
      </link-entity>
</entity>

To specify your FetchXML query, see step 5 in Set Up and Configure the Dynamics 365 Connector.