Skip to main content
Tool-page

FetchXML Builder

Build FetchXML queries for Dataverse without writing XML by hand.

Paste the output of List rows or the Web API (the whole object with value works). The tool reads the table from @odata.type, hides OData annotations and shows lookups as column names without _..._value. Then you pick columns, conditions, sorting and top, join more tables with link-entity, build aggregates with groupby or page through results with count, page and the paging cookie. For Power Pages lists you can output only the filter element.

Open FetchXML Builder

Free. You enter your email address once, then all tools are unlocked. Your data is processed locally in your browser.

How it works

  1. Paste List rows output or type the table name.
  2. Pick columns and add conditions with operators such as eq, like, begins-with, in or eq-userid.
  3. Optionally add linked tables, aggregation, distinct or paging.
  4. Set sorting and top, then copy the FetchXML. Notes below the output flag combinations Dataverse rejects.

Example: active accounts with Contoso in the name

<fetch top="50">
  <entity name="account">
    <attribute name="name" />
    <order attribute="name" />
    <filter type="and">
      <condition attribute="statecode" operator="eq" value="0" />
      <condition attribute="name" operator="like" value="%Contoso%" />
    </filter>
  </entity>
</fetch>

Example: accounts without a contact (anti-join)

<fetch>
  <entity name="account">
    <attribute name="name" />
    <filter type="and">
      <condition entityname="c" attribute="parentcustomerid" operator="null" />
    </filter>
    <link-entity name="contact" from="parentcustomerid" to="accountid" link-type="outer" alias="c" />
  </entity>
</fetch>

Frequently asked questions

Is the FetchXML Builder free?

Yes.

Is my data uploaded?

No, the XML is built locally in your browser.

Which operators are available?

Among others eq, ne, gt, ge, lt, le, like, not-like, begins-with, ends-with, in, not-in, between, on-or-after, last-x-days, today, eq-userid, null and not-null. FetchXML uses words, not symbols such as = or >.

How do I filter on part of a text?

With like and percent signs as wildcards (value="%Contoso%"), or with begins-with and ends-with.

Do I need mapping="logical"?

No. The attribute is legacy and no longer listed in the current Learn reference. Address columns by their logical name in lower case.

Does the tool support link-entity or aggregation?

Yes. Linked tables with inner, outer, exists or in, columns and conditions of the linked table, and the anti-join (outer with operator null). For aggregates there are count, countcolumn, sum, avg, min, max, groupby and dategrouping, and the tool sets aliases automatically (tip 39).

How does paging with the paging cookie work?

Set the page size (count) and the page (page). For more than 50,000 rows, paste the value of the @Microsoft.Dynamics.CRM.fetchxmlpagingcookie annotation: the tool URL-decodes pagingcookie twice, escapes it for paging-cookie and takes over the next page. top is then left out, because Microsoft Learn does not allow top together with paging.

Related tips

All tips in the archive

Microsoft and the Power Platform product names (for example Power Apps, Power Automate, Copilot Studio) are trademarks of the Microsoft group of companies. This is an independent website. It is not operated, sponsored or endorsed by Microsoft.