Create a child flow to invoke HTTP request to D365

Our child record should be triggered manually (also includes invocation from another flow) and contain the necessary properties to dynamically create the HTTP request:

manual trigger properties

First we need to initialize the variables to authenticate with the D365 environment. In our example we use an application user. For that we need the Azure Active Directory ID (AAD ID), Client-ID and Client-Secret from an app registration. See this article.

initialize authentication variables

After we know the variable values we can get a token from D365:

aquire token from D365

After that we parse the response to JSON:

parse the response token

Now we are able to execute the request using the access_token node of our parsed JSON response. The method, URI, Query and Request Body are taken from the manual trigger of the child-flow.

execute http request to D365

Finally we return the response and status code to the calling entity:

return to calling entity

Calling a child flow for custom HTTP Request to D365

We can now use our child flow to create custom calls. In this example we generate a PDF using the Microsoft.Dynamics.CRM.documenttemplate action.

calling a childflow in Power Automate

Add comment