FetchXML Formatter and Converter
Format and check FetchXML, then turn it into a Web API URL, JavaScript or C#.
Runs in your browser. Nothing you enter is uploaded.
Formatted
Paste a FetchXML query to format, check and convert it.
About FetchXML Formatter and Converter
FetchXML Formatter and Converter takes a FetchXML query and makes it readable, checks it for common mistakes, and gives you ready-to-use code for the Web API, form scripts and the SDK for .NET.
Your query is wrapped as it is, so its filters and links behave the same way in every output. The checks catch common mistakes, but only Dataverse can confirm that tables and columns exist. This is an independent tool, and is not affiliated with or endorsed by Microsoft.
How to use FetchXML Formatter and Converter
- 01Paste your FetchXML, or open a file.
- 02Fix any errors, and review any warnings.
- 03Check the entity set name, then copy the Web API URL, JavaScript or C#.
Features
- Formats FetchXML with consistent indentation
- Finds missing names, operators and aliases
- Warns about paging without an order, top combined with paging, and returning all columns
- Generates a URL-encoded Web API request
- Generates Xrm.WebApi JavaScript and C# FetchExpression code
- Warns when a URL exceeds the 32 KB GET limit
Frequently asked questions
- How do I run FetchXML with the Web API?
- Add it to the table's entity set as a URL-encoded fetchXml query parameter, such as /api/data/v9.2/accounts?fetchXml=. This tool does the encoding for you.
- What is the difference between the entity name and the entity set name?
- FetchXML uses the logical name, such as account. The Web API URL uses the entity set name, usually a plural, such as accounts. The tool suggests one, but check it against the table's EntitySetName, because custom tables can differ.
- What if my FetchXML makes the URL too long?
- A GET URL is limited to 32 KB. For longer queries, send a POST to $batch with the FetchXML in the request body. The tool warns you when this applies.
- Can I use top with paging in FetchXML?
- No. Microsoft's documentation says top is not compatible with the paging attributes page and count, so use one or the other.
- Is my query sent anywhere?
- No. It runs entirely in your browser, and nothing you enter or open is uploaded, stored or sent to a server.