AI Lands in FetchXML Builder
Building FetchXML queries with FetchXML Builder has never been easier now that AI-driven query generation is available.

Intro
AI has landed in FetchXML Builder! If you have used FetchXML Builder recently, you would have noticed an update is available. After update, the AI Chat view is now made available.

You can use this feature to give a plain statement to AI Chat and it will create or edit the existing FetchXML query for you. Once the query is constructed, AI Chat will offer to execute the query for you.
Prerequisites
Pretty cool huh? So, what do we need to enable this functionality?
-
An AI Supplier
-
A Model
- OpenAI Models
- gpt-4.1
- gpt-4.1-mini
- gpt4.1-nano
- Anthropic Models
- claude-3-5-haiku-20241022
- claude-3-7-sonnet-20250219
- claude-sonnet-4-20250514
- OpenAI Models
-
Once you have selected a supplier, you must acquire an API key (I have conveniently supplied links to the respective suppliers above)
- This will (likely) require you to purchase credits
Once you have acquired your API key from your selected supplier you can plug the info in to the FetchXML Builder settings.
Click Options in the ribbon and select Settings.

Select the AI Chat tab.

Plug in your info and click the OK button.

Time To Work
To open the AI Chat menu, click the View button in the ribbon and select AI Chat.

Let's try getting a list of all contacts related to an active Account.
I used the following prompt for this:
Provide a list of all contacts related to an active account
Let's watch it work!
Notice it generates the query for us.


If you are just starting to learn and understand how to build FetchXML queries, this is powerful. You can reference the query builder to see how the model built the query so you can begin to build queries on your own as you learn more.
Now that we have taken a look at the generated query, let's check in with the AI Chat panel.
The response from AI Chat asks if we want to execute the query.

And voila! The query is executed successfully and the results are shown!
Wrap Up
Pretty neat huh? As with all things AI, I suspect with time this will only get better.