Reuse Flows connected to SharePoint Lists – Working again

In our previous attempt (Reuse Flows connected to SharePoint Lists), we tried an approach using the Referer property from the header section of the request to discover which list or document library was triggering the Flow. Using this property, we could get the Site URL and the List ID from SharePoint by dissecting the URI.

The following is an example of the URI received:

"Referer": ""

Some weeks after posting this workaround, a security policy broke the proposed solution. Because of this, sometimes we receive the expected data, but others we just receive: “Referer”: “

Making it difficult to discover information about who triggered the Flow.

A new approach

Remember that in the first post we commented about the itemUrl parameter? SharePoint sends these two types of URIs when triggering the Flow:

Example one:


Example two:


This new approach uses these two types of URIs to discover the SharePoint site and list / library. This is the only change from our previous workaround.

Dissecting data

The following is an overview on how to detect the link type in a Cloud flow:

Reuse Flows connected to SharePoint Lists – Working again

First, we will use one of the best practices for building flows in Power Automate: Scopes. This way we can build a try-catch mechanism when detecting the SharePoint site URL and List.

ESPC call for speakers 2024
The Detect Link type scope dissects the link. If everything goes as expected, the execution will continue to the Main scope, but if there is an issue, it will continue to the Error management scope.

Detecting link type

Through a series of actions and formulas, we will get the information we need. When we receive a link containing the _layouts text, we will get the SharePoint site URL and the List ID in GUID format. The other option will get the SharePoint site URL as well, but you will get the List name instead of the ID.

Reuse Flows connected to SharePoint Lists – Working again

Power Automate’s SharePoint actions can use List names or GUIDs, but if you want to have a more concise solution, you can also send a request to SharePoint to get the List ID in GUID format so we always have the information in the same format.

Get the code

The proposed solution can be downloaded from the PowerAutomate-Samples GitHub repository. The example is called: Teams Notification Handler.

There’s more

Thanks to this wonderful community, there is another approach to tackle this using subscription information from SharePoint. Take a look at this by visiting Tomasz Poszytek’s blog.

For more great content, check out the Resource Centre

About the Author:

Author | Business Apps MVP | MCT | Team Lead @ Intelequia


Mendoza, E. (2021). Reuse Flows connected to SharePoint Lists – Working again. Available at: [Accessed 16th April 2021].

Share this on...

Rate this Post: