Construct a FetchXML document string with a fetch element, entity element, and attribute elements for the fields to retrieve
Add link-entity child elements to join related tables using the to and from attributes for the join keys and link-type for join style
For aggregates set aggregate=true on the fetch element and use aggregate attributes (sum, count, avg) with an alias on each field element
Encode the FetchXML string and pass it as a fetchXml query parameter to GET /api/data/vX.X/<entitysetname>
For large result sets check the @Microsoft.Dynamics.CRM.fetchxmlpagingcookie annotation in the response and pass it back in subsequent requests using the pagingcookie attribute on the fetch element
Use the Dataverse FetchXML builder in Power Apps to iteratively construct and test complex queries before coding them
Known gotchas
FetchXML aggregate queries cannot be combined with record-level paging; you must retrieve all aggregate results in one call or partition manually by a filter dimension
The link-type inner performs an INNER JOIN while the default is an outer join; misunderstanding this causes unexpected missing records in results with null-able foreign keys
URL-encoding the entire FetchXML string is required; unencoded angle brackets in the query parameter cause a 400 Bad Request
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp