Three Simple steps to use Fetch XML query in Microsoft Power Automate Flow.

Power Automate Fetch XML

Three Simple steps to use Fetch XML query in Microsoft Power Automate Flow.

Recently in Dynamics 365 I came across data migration-related work where it took too much time for inserting data into the custom entity and even sometimes the flow was a timeout.

As a developer-first thing that came to mind was I needed to keep the limited fields & have a proper filter on flow and then I saw that the power automate is providing the Fetchxml feature.

Now here we just need to build the XML query and for this, there are two ways to do first is FetchXML Builder & second Dynamics 365 Views we will see both ways.

Step 1: XRMToolbox FetchXML Builder

Here we need to go to the XRMToolbox and click on the “Open Tool Library” option to install FetchXML Builder and after installation is done then open this tool & click on “Open” option and select “Open View” where you need to select the entity & view & after that XML query will generate.

Step 2: Generate the FetchXML query in Dynamics 365 view.

In Dynamics 365 go to the "Advance find" Option & select the entity & apply the appropriate filter. Now click on FetchXML option to download the XML file, and then open & copy XML code.

Step 3: Use of FetchXml in Power Automate.

Open the Power Automate flow and select the CDS connector & chose "List records" option. Now you need to provide the Entity name here I have added “opportunities” and down below you can see the Fetch XML Query Option, Paste the XML code where previously copied from the download file and run.

Here we can see the results and with help of fetchxml can reduce the load on Power Automate flow also minimize the execution time.

Comments