Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

How to get a link to Power Automate flow running on a specific SP item

Posted on August 18, 2021August 18, 2021 by Tom

“Can I link SharePoint item directly to a specific flow run to easily find the right Power Automate flow instance? It takes so long to find the right flow in the run history.”


If you run a flow very often, e.g. for each update of each SharePoint item, you’ll have a lots of runs. And lots of runs mean a lots of entries in the flow run history. And the more entries you have, the harder it gets to find the right one.

When you search for a flow that did run on a specific item, you might end up checking 10+ flow runs until you find the right one. It’s bit of a step back from the old SharePoint workflows where you could add the link to the flow with a single checkbox. If you want such a link to Power Automate flow, you must add it by yourself.

Build the link to the flow

Opening any existing flow run history in a browser, you’ll see that it has always the same format. There’s the environment id, flow id and flow run id, and then the rest of the url. Therefore, if you knew the 3 ids, you could build the link to the flow run manually.

https://emea.flow.microsoft.com/manage/environments/<environmentID>/flows/<flowId>/runs/<runId>

For example:

https://emea.flow.microsoft.com/manage/environments/Default-c3adda97-1234-44f6-9fbb-ecf0395f334b/flows/2ef6c1be-1234-4c58-8c69-55783da7f30e/runs/08585722999521234205098139360CU227

Power Automate has an expression workflow() that will give you all the information about the running flow. Among the information are the 3 id’s required to build the url. All you need to do is to build the whole url string by combining the fixed parts and the workflow() parts.

Power Automate item flow link

Build the whole url with the concat(…) expression, and workflow() expression with a bit of JSON navigation.

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

Store the url in a column in the SharePoint item and you’ll get a direct link to the flow run. Just be careful about the potential infinite trigger loop.

Summary

It’s easy to get lost in the flow run history if your flows run very often. Power Automate by itself doesn’t offer any connection, any link between a SharePoint item and a flow run. Therefore, if you want a direct link in the item properties, you must build and update it by yourself.

And it’s not the only usage of the link as already shown in the instant error messages from your flows.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

2 thoughts on “How to get a link to Power Automate flow running on a specific SP item”

  1. Chris Florian says:
    March 1, 2023 at 5:58 pm

    I tried your code above.
    I selected the list item and clicked Automate and my workflow.
    It stored the url in a field in the list item.
    When I try the created url all it does is open the workflow history for the run that generated the URL.
    I REALLY want this to work.

    Reply
    1. Tom says:
      March 15, 2023 at 4:14 pm

      Hello Chris,
      that’s what the flow does, stores the url to the flow that updated the link, that’s why the link should be set in the actual flow that’s doing the work.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes