Use FetchXML in the Power Automate CDS Connector for List Records

Leave a comment

In this post, we will look at how to use FetchXML in the Power Automate Common Data Service Connector to retrieve records using the List Records Action.

If you prefer to learn by video, check out my YouTube channel video on how to do this:

First, log into https://flow.microsoft.com and go to Solutions and create a new solution:

Give it a name and click Create:

Open the solution and click New->Flow:

We will trigger this from a Flow Button. Let’s select Manually trigger a flow:

You should see:

Search for Common Data Service and choose the Common Data Service Current Environment connector and select List Records (don’t choose the Common Data Service connector without the Current Environment or you will not see the FetchXML option later):

Select your environments and click Show advanced options:

Clicking show advanced options, we see the FetchXML Query:

Let’s create a FetchXML query to use. We will use the FetchXML Builder in the XrmToolbox. You could also use Advanced Find or your preferred tool to create FetchXML:

Create a new query:

We will create a query where the revenue of the account is greater than $1M:

Copy the FetchXML:

And let’s throw it into our Flow:

Save the Flow and let’s test it:

Once complete, look at the flow run. For the output of the List Records, we get a 200 OK status:

And in our HTML body we get the fields we selected, name and revenue, displaying accounts with $1M revenue:

A useful feature if you would like to take advantage of FetchXML in Power Automate.

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *