This post builds on this blog which talks about using the SQL CDS tool to search for Power Automate Flows that modify a specific Dataverse column

In this post we look at interrogating the Power Automate Flow definitions to investigate bugs/changes, and also accessing the Flow’s cliendata property in scenarios were organizations don’t allow you to use XrmToolBox.

Scenario

Lets say I’ve been asked to change something or investigate a problem that involves a specific Dataverse column and I’m looking into the impact of the change. I’m interested in checking any related Power Automate Flows that reference that column to see:

  • Is it a child flow / does it call any child flows
  • What the Flow is doing – as a brief description
  • etc.

With a combination of the Web API and ChatGPT we can find all the Power Automate Flows that reference that and then ask ChatGPT to give us a summary and call out for example if there are any child flows being used by that process – to give us an idea of the impact of changing the column.

Getting Flow definitions using the Dataverse Web API or OData query

We can use these OData queries

Find all flows referencing column ‘new_newlicenceitem’

https://yourorg.crm11.dynamics.com/api/data/v9.2/workflows?$select=name,workflowid,clientdata&$filter=category eq 5  and contains(clientdata,'new_newlicenceitem')

Get name, workflowid, and clientdata for all Power Automate flows – may need to modify this query a bit as it could return a lot of data

https://yourorg.crm11.dynamics.com/api/data/v9.2/workflows?$select=name,workflowid,clientdata&$filter=category eq 5

We could also create a reusable manual cloud flow that we run each time:

Searching for Flows using other properties

The above example is searching based on the column schema name, however we can search for the below in the clientdata flow JSON to find for example triggered by the ‘instructor’ table

"subscriptionRequest/entityname": "cm_instructor",

It would be a case of exploring the cliendata attribute for the kind of information that you are looking for and then asking ChatGPT to help you find it by providing an example.

Get ChatGPT to help you summarize the Flows

Once you have run any of the above queries you will get a JSON blob that describes a collection of Power Automate flows.

Entering the OData query into the browser – you can save this as a file.

After running the Flow that calls the Web API

Click the ‘Show Raw Outputs’ button and you can copy the JSON from the Compose action:

You can upload this file to ChatGPT and start to ask it to create a table summarizing the flows, what they do, if they are child flows, call child flow etc. by refining the prompt and telling it about what you are interested in:

Now I’d like to include info about triggers

Also ask about calling child flows