cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Dynamically getting Folder name in Sharepoint

Hi Everyone,

 

I have a serial approval flow that is deployed on multiple lists and libraries. It is triggered manually on selected item. I was recently asked to add the link of the folder where the item is in the email that approver receives. I cannot find a way to add folder link dynamically to the mail. 

 

Is there a way to capture the folder of the list item the flow is triggered on?


Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Dynamically getting Folder name in Sharepoint

@hkhan :

 

The following expression should give you a link to the folder:

substring(body('Get_file_properties')?['{Link}'],0,lastIndexOf(body('Get_file_properties')?['{Link}'],'/'))

 

To insert a hyperlink in the email, simply wrap the expression above inside of a hyperlink tag and set the "is HTML" property of the email to true.

 

The Link to Item Dynamic property returns the fill path and file name.

The expression first finds the last instance of a backslash in the item link - that is where you want to cut the text.

The substring expression is used to "cut off" elements at a specified length.

 

Please give it a try and let me know if this works for you.

 

If this solves your issue, please mark your post as Solved.

If you like my solution, please give it a Thumbs Up,

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Dynamically getting Folder name in Sharepoint

@hkhan :

 

The following expression should give you a link to the folder:

substring(body('Get_file_properties')?['{Link}'],0,lastIndexOf(body('Get_file_properties')?['{Link}'],'/'))

 

To insert a hyperlink in the email, simply wrap the expression above inside of a hyperlink tag and set the "is HTML" property of the email to true.

 

The Link to Item Dynamic property returns the fill path and file name.

The expression first finds the last instance of a backslash in the item link - that is where you want to cut the text.

The substring expression is used to "cut off" elements at a specified length.

 

Please give it a try and let me know if this works for you.

 

If this solves your issue, please mark your post as Solved.

If you like my solution, please give it a Thumbs Up,

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Highlighted
Helper I
Helper I

Re: Dynamically getting Folder name in Sharepoint

It will be great if Microsoft created a Flow to call other flows, or the possibility to use one Flow across multiple Libraries / Sites.

With dynamic update of Site / Library fields.

 

The idea has been already proposed, and needs sufficient number of Votes for it to be considered..

https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Deploying-a-Singular-Flow-across-Multiple-S...

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,942)