Skip to main content

Notifications

Community site session details

Community site session details

Session Id : BH8ObK6/ZEyYoSJ7zMkYGz
Power Automate - Building Flows
Unanswered

Get the file path using the share link

Like (0) ShareShare
ReportReport
Posted on 23 Jan 2024 20:57:05 by 4

Hi! I'm really dumbfounded about this seemingly simple question, I haven't found an answer on Google or these forums so here it goes.

How can I get the "relative path" or "path" for a SharePoint file using only the URL you get by right-click + "copy link"´?

Basically, I need to go from this: https://mysite.sharepoint.com/:x:/s/ExampleSharepointSite/EcubcEpU-5pEnFmhMrKVzwUB8y6DyZwsBmMSeMBdHhxnHQ?e=goOpUa  

to this: /Shared Documents/Test Folder/some-random-document.xlsx

I'm really confused.

  • ashmand Profile Picture
    25 on 19 Jun 2024 at 14:14:29
    Re: Get the file path using the share link

    @EZuniga did you figure out how to solve this? I have a similar issue where I want the user to get the folder path of a shared folder link (as opposed to a shared single file link).

  • EZuniga Profile Picture
    4 on 25 Jan 2024 at 17:29:22
    Re: Get the file path using the share link

    Hi! First of all, just to be clear because it confuses me a little too, I'll refer to the examples as following

    Share link = https://mysite.sharepoint.com/:x:/s/ExampleSharepointSite/EcubcEpU-5pEnFmhMrKVzwUB8y6DyZwsBmMSeMBdHhxnHQ?e=goOpUa  

    File Path = /Shared Documents/Test Folder/some-random-document.xlsx

    With that out of the way... The problem is that I don't have a file path to begin with 😕 the trigger to this flow is a forms response, and in one of the answers the users copy and paste the share link to said file.

    I tried using the Get File properties and Get file metadata but it expects me to input the file path or identifier... which I can't figure out how to parse just out of the share link.

    Is there a way to use those actions with JUST the share link?

    Thank you so much

  • eliotcole Profile Picture
    4,218 Super User 2025 Season 1 on 23 Jan 2024 at 21:53:08
    Re: Get the file path using the share link

    I don't actually have the time right now, but I looked into this a while back, @EZuniga ... if you can't actually use something like the render list items as a stream API endpoint, you could setup any given list to save that url in a hidden column.

     

    I do think that the data is kept somewhere accessible, though ... take a look at this API explorer, perhaps?

    https://s-kainet.github.io/sp-rest-explorer/#/

  • creativeopinion Profile Picture
    10,406 Super User 2025 Season 1 on 23 Jan 2024 at 21:48:34
    Re: Get the file path using the share link

    @EZuniga You'll need to use the Full Path dynamic content from the Get File properties action.

     

    creativeopinion_0-1706046344977.png

    creativeopinion_1-1706046387304.png

    Or, if you are using the Get file metadata action, you'll need to use the Path dynamic content.

    creativeopinion_2-1706046491992.png

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution .
    Consider giving me a 👍 if you liked my response! If you're feeling generous— ️  Buy me a coffee: https://www.buymeacoffee.com/acreativeopinion

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok
     

     

    For more flow troubleshooting tips—check out this YT Tutorial: 5 Power Automate Troubleshooting FAQs and Helpful Tips for Creating Better Flows

    In this tutorial I cover:

     How to troubleshoot a false Condition action result

     How to get dynamic content when it isn’t selectable from the list of dynamic content

     How to troubleshoot an Apply to Each action that isn’t looping through

     How to troubleshoot a skipped Apply to Each action

     How to troubleshoot a Filter Query

     How to use a SharePoint yes/no column in a Filter Query

     How to use Compose actions to troubleshoot a Power Automate flow

    How to troubleshoot multiple emails being sent

     How to troubleshoot multiple Teams messages being sent

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,780 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started