Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Get link to a folder of a newly created file with Power Automate

Posted on March 1, 2023March 1, 2023 by Tom

“I’d like to send a link to the whole folder with the newly created file, how can I get such link with Power Automate?”


If you trigger flow on a new file in a SharePoint library, you probably send a link to this file in some message, whether it’s a Teams message or an email. The link is hidden under the ‘Link to item’ dynamic content and that’s all you need. Just one dynamic content. But what if it’s not just about the single file? If the users should know about all the other files in the same folder? How do you build a link like that?

Start with the Folder path

There’re two dynamic contents related to the file location – Full Path and Folder path.

Full Path will give you the path to the file on the specific site, including the file name, e.g.

Shared Documents/PDF files/Subfolder/file.pdf

Folder path will give you the same, excluding the file name, e.g.

Shared Documents/PDF files/Subfolder/

…and that’s where you want to start. But it’s only the start as you can see that it’s missing the url of the SharePoint site.

Add the site url

Since all flows are bound to a SharePoint site, you can hardcode that site in the url. Use the concat(…) expression to combine it with the folder path.

concat('https://xxx.sharepoint.com/sites/siteName/', triggerOutputs()?['body/{Path}'])

Replace the spaces

Depending on your usage of the link there might be one more thing to do. If you send it as a plain link, it’ll end the url with the first space.

To turn it into a whole link you must get rid of the spaces. Add one more expression around the concat(…) to replace(…) each space with the %20 character (an url representation of a space).

replace(concat('https://xxx.sharepoint.com/sites/siteName/', triggerOutputs()?['body/{Path}']),' ', '%20')
Power Automate folder link

Once you replace the spaces you’ll get a fully working (and clickable) url.

Power Automate folder link

Summary

While Power Automate doesn’t give you a direct link to a folder with a specific file, you can build it yourself. Take the SharePoint site url that’s fixed, add the folder path, and replace the spaces. That’s it, you just built a direct link to a folder with that specific file.


🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

6 thoughts on “Get link to a folder of a newly created file with Power Automate”

  1. Maximilian Sellmaier says:
    July 25, 2023 at 4:08 pm

    Thank you for your post.
    It helped me a lot and saved a tone of time!

    I used the manual trigger of a document to start an approval process.
    Therefore, I needed to save the URL in a Sharepoint-List.

    I just used the expression concat(‘https://xxx.sharepoint.com/sites/sitname/’, — dynamic conent — )
    The “dynamic content” was selected and inserted with the mouse-click. The input for the “dynamic content” I used is called “link to file”.

    Best regards,
    Max

    Reply
  2. mbodji says:
    November 10, 2023 at 1:07 pm

    Good feature, very interesting. In fact I want to link the folder link and list item in sharepoint. The user submits the new item and get also the folder link created in document library,so the approval can see the contain of document to approve by clicking the link in the item instead of using attachment files

    Reply
  3. mbodji says:
    November 10, 2023 at 1:36 pm

    Powerautomate handles now the space of link and replace it automatically by %20;

    Reply
  4. Stephanie Norman says:
    January 31, 2024 at 8:51 pm

    What if the folder is renamed? How can you use Power Automate to update the link?

    Reply
    1. Tom says:
      February 28, 2024 at 8:29 am

      Hello Stephanie,
      you can’t, sending the link is a one time action. If you rename the file you’d have to recreate all the links and send them to all the users again.

      Reply
  5. Felipe de Abajo Aragón says:
    February 5, 2024 at 4:54 pm

    Yet another great tutorial 😊.

    Thanks a lot

    Reply

Leave a Reply Cancel reply

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

🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

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 thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes