cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User III
Super User III

@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
Super User III
Super User III

@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

Advocate I
Advocate I

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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (51,456)