FetchXML Builder

Build a focused FetchXML query locally with entity and attribute names, one AND or OR condition group, simple link-entities, sorting, distinct, paging, count, and total-record-count options. The live XML can be validated, copied, downloaded, or initialized from a best-effort XML import.

How to Use the FetchXML Builder

Assemble a focused FetchXML query from logical names, watch the live XML update, then copy it into your own Dataverse tooling.

  1. Enter the primary entity logical name and add the attribute logical names you need.
  2. Optionally enable distinct or total-record-count, then add an AND or OR condition group with attribute, operator, and value.
  3. Add simple inner or outer link-entities (from, to, alias, comma-separated attributes) and any sort orders.
  4. Set page and count, inspect the live preview, and run Validate for basic structure checks.
  5. Copy or download the XML. Upload XML only when you want the best-effort importer to populate supported form fields.

Build method

Hand-writing FetchXML is easy to mistype. The builder’s method is form-driven emission: escaped attribute values, a single entity, optional filters and joins, and paging attributes—without calling your environment.

Worked example

For active account names: entity account, attribute name, filter type and, condition statecode eq 0. The preview emits a fetch root with mapping="logical", the entity, attribute, and condition elements, plus any page/count you set.

Reading the live preview

  • Attribute values you type are XML-escaped in the output.
  • Link-entity blocks appear only when a link name is present; alias defaults to the link name when left blank.
  • Validate success means the text looks structurally sound—not that Dataverse will accept or perform well.

Mistakes and limitations

  • Use logical schema names, not display labels.
  • One mixed AND/OR tree is not supported—only a single filter type for the condition list.
  • Importing complex XML can silently drop unsupported pieces; always re-read the preview.

Privacy note

Form values and selected XML files are processed only in the browser. Avoid putting secrets in filter values that you later copy into tickets, chats, or shared files.

FAQ

Does this connect to my Dynamics 365 environment?

No. It constructs FetchXML text in your browser and never authenticates to Dataverse or sends the query to a ToolsLibrary server.

What query shape can the builder emit?

One primary entity with attributes; one flat AND or OR filter group; simple inner or outer link-entities with from, to, alias, and attributes; sort orders; plus distinct, page, count, and returntotalrecordcount options.

Which condition operators are available?

The UI offers common FetchXML operators such as eq, neq, gt, ge, lt, le, like, not-like, null, not-null, in, not-in, begins-with, ends-with, and contains. null and not-null omit the value attribute in the generated XML.

What happens when I upload existing FetchXML?

A best-effort regex parser merges supported fields into the form. Nested filters, nested links, aggregates, attribute aliases, and other advanced constructs may be lost, flattened, or ignored—review the live preview after import.

What does Validate actually check?

Basic XML well-formedness, a fetch root, an entity name, and whether attributes appear to be present. It does not read Dataverse metadata, estimate performance, or prove the query will succeed in production.

Can I build aggregates, nested filters, or multiple filter groups?

No. The builder targets a focused subset: one entity, one flat filter group, and simple link-entities. For richer FetchXML, edit the XML elsewhere or extend it after copy.

What should I verify before running the XML in Dataverse?

Confirm logical names, relationship from/to attributes, operator values, aliases, security privileges, and expected row volume in an authorized environment. The builder does not inspect your schema.