Wednesday, February 17, 2021

Query D365 ce using fetch xml in azure logic app (without cds connector)

 Step 1:- Go to your azure subscription and create a new logic app (http triggere in our case):

2.png

Step 2:- Save the logic app and click on next step and initialize a variable to store your fetch xml:

3.png

Step 3:- Name your variable and paste your fetch xml in the value:

4.png

Step 4:- Click next step and select http action:-

Step 5:- Now select values as follows:

Method: Get

URI: https://<yourd365ceinstance&gt;.api.crm8.dynamics.com/api/data/v9.1/<entitypluralname>?fetchXml=

8

Step 6:- Now we have to pass encoded fetch xml declared in variable in step above.

For that click after = in URI and paste “uriComponent(variables(‘fetchxmltoexecute’))” in dynamics content section and click ok.

What it does?

This uriComponnet method encode the fetch xml stored in variable fetchxmltoexecute.

Your step should look like this:

10

Step 7:- Now select authentication method as Active Directory OAuth:

11

Step 7:- Set the rest of the parameters as follows:

Tenant : Azure tenant id

Audience : your CE url

Client Id: Azure ad application id/ Clientid

Credential Type: Secret

Secret : A valid secret generated for above ad app

12

Step 8:- Now save the logic app and click on run button and wait for few seconds on same screen.

Looks like all steps got succeeded..!!

1314

Step 9:- Let’s click on last http step and see the output. Data from account record is visible in body of the action:

15.png

You can write complex fetch and pass filters dynamically and execute all those request using this way.

Similarly you can directly fo CURD operation on ce/cds using such http action and without using cds connector.  It’ll be useful in scenario like where you want to update only delta on a record in ce/cds. Then you can build your json and post the json using post/patch method on desired entity.

Hope it was helpful..!!


Link Verified : Query D365 ce using fetch xml in azure logic app (without cds connector) – Dynamics 365 CE/Power Platform, PowerApps, Power Automate, Azure by Vishal Grade

No comments:

Post a Comment

Day 11 - Customizing Option Sets Dropdown Fields with JavaScript

  In this Blog, we will see how to Customizing Option Sets Dropdown Fields with JavaScript label1 = formContext.getAttribute( "bosch_op...