Parsing the flow data for debugging
Flow Microsoft 365Data for any run of a flow can be retrieved, parsed, and used for debugging purposes via the workflow() function. The data includes properties that identify the flow which can be used to identify the run and allow you to do things like a link to that particular run or send rich notifications when a flow runs.
To do this, there are a few steps involved that could be part of any flow.
-
- Add a Compose step and set its input to workflow().
- Then add a ParseJSON step and set its content to the Output of the previous step. We will set the Schema field empty to an empty object, {} for now as we will need to retrieve it first.
- To retrieve the schema of the workflow JSON, we will first need to save and run the flow.
- Next, view the output of the run and copy the resulting JSON.
- Return to the flow and select Generate from Sample in the ParseJSON step. Paste the copied output and click done.
- Doing this will generate a schema from the JSON output which looks like this. Tip: This can be done for any JSON response from an endpoint when you do not have the schema readily available.
- From here you can use the data about the current run in the subsequent steps. In this example, the data is initialised as an object variable.
- Add a Compose step and set its input to workflow().