Which flow run is related to my SharePoint list item or document

In one of my recent posts I mentioned the workflow function in Microsoft Flow. In this post I looked at which elements are needed to create the Url used by flow run.

With my two Compose actions I’m first collecting the flow details with the workflow function:

workflow()
Then my second compose action will build up the Url using the concat function  collecting output from the details supplied by the first Compose action.
concat('https://unitedkingdom.flow.microsoft.com/manage/environments/',
outputs('Compose’)['tags']['environmentName'],
'/flows/',
outputs('Compose’)['name'],
'/runs/',
outputs('Compose')['run']['name'])

With this all in place I can now get the workflow history run of my flow. This I can now email to myself when something goes wrong making it very easy to identify the failed flows.

if you prefer not to use the Compose actions you can of course also simply include the following in an email set out to a user:

concat('https://unitedkingdom.flow.microsoft.com/manage/environments/',
workflow()?['tags']['environmentName'],
'/flows/',
workflow()?['name'],
'/runs/',
workflow()?['run']['name'])

4 thoughts on “Which flow run is related to my SharePoint list item or document

  1. commented on May 30, 2019 by Praveen

    I appreciate your time to blog this article. And this is a good tip when we are talking about these flows as they are not connected to the list items/documents like earlier SharePoint workflows. In a big organization where multiple instances of flows are running there is no easy way to track the specific flow instance. Its a hell. Thanks for showing a solution which is at least giving option to find that specific culprit flow ran.

  2. commented on October 24, 2019 by Marcos

    Great solution. Quick question, why not use a variable instead of the second Compose action?

    • In general I avoid variables when I can. You will find that when you use variables loops and concurrent branches will lock on the variable usage. Compose actions don’t have these locks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: