web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / sharepoint list column...
Power Automate
Answered

sharepoint list column hyperlink to open excel file online

(0) ShareShare
ReportReport
Posted on by 76

Hi Everyone,

 

I have a sharepoint list which has a hyperlink column. The link to the excel file is generated by a power automate flow (an update item action) which currently downloads/opens in the desktop app. I would like the excel file to open in the browser, in a new tab.

 

I tried adding ms-excel:ofe|u| to my URL but got an Invalid URL error msg. I also tried adding ?Web=1 to the end of the URL but got the same error

 

My URL is generted like so....

https://mydomain.com/:x:/r/sites/SiteName/Shared%20Documents/Sub%20Folder/tester_title.xlsx

 

Any help/suggestions would be much appreciated.

 

Thanks,

Syed

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    The url and parameters are different for Excel Online.  Here are the parameters that I think you will need.

     

    It will look like this example

    https://acmee3.sharepoint.com/sites/FlowDemos/Shared%20Documents/LoopBack_20_21.xlsx?d=wc5e89b4b7f4f4b36acd66622c891ad44&action=default&mobileredirect=true

     

  • syed_sme Profile Picture
    76 on at

    Thanks @Pstork1

     

    So, to give a little more context, the update item action updates the link column to the file in the doc-lib, in the following format.....

    Capture.JPG

    once the list item is created. 

     

    I went down this route as the file gets moved to a different sub-folder after an approval step. I haven't found a solution to be able to maintain file ID consistency as the file moves to a different folder the ID changes, and thus unable to update the list item with correct link.

     

    So, although your suggestion works when i copy the file link from the doclib and add the section - &action=default&mobileredirect=true - to the end of that link, the true link (code) changes once moved to another folder. The only thing that i can see which is consistent is the filename which is why I am using the update item action as above.

     

    Interested to know your thoughts on my method and if you have any other suggestions? 

     

     

  • Verified answer
    Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    If you turn on the Document ID Service in the site collection it should change the link to one that uses the ID for retrieval.  That link will work anywhere you move the document within that site collection.

    image.png

  • syed_sme Profile Picture
    76 on at

    thanks @Pstork1

     

    I will ask Admin to check that for me as that will help with a lot of other things.

     

    I have however found another way to resolve the issue by taking the sourcedoc code from the file link when opening it direct from the doc-lib, and adding that part to the URL along with the piece of code you suggested......

    https://mydomain.sharepoint.com/:x:/r/sites/MySite/_layouts/15/Doc.aspx?sourcedoc=%7BF75545D4-5305-4F31-A881-79E25C3F58EF%7D&file= <filename dynamic content> &action=default&mobileredirect=true

     

    This seems to be working now.

     

    Thanks again. I'll mark this as resolved.

     

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    That was my original idea.  The problem is that I couldn't find any way to get the GUID value for Sourcedoc using flow alone.

  • syed_sme Profile Picture
    76 on at

    Hi @Pstork1,

     

    Seems i was too quick to think this was resolved. Turns out I mistakenly thought the GUID value for Sourcedoc was specific to the doclib. Obviously this is a unique ID referring to each file. 

     

    Any ideas how i could go about getting the GUID value for Sourcedoc? You said its not possible via flow alone?  What else do you think would be necessary?

     

    Or perhaps there is a better alternative to using this method to open the file in the browser?

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    I was hoping that turning on the docID service would change the link to item to the sourcedoc.  It appears from the tests I did yesterday that it doesn't.  but it may take time for the links to be change, so that still might work.

     

    However, I now think there is a way to get the guid for sourcedoc from the link to item in flow.  If you look at the last parameter in the link it will be something like this.

    ?d=wc5e89b4b7f4f4b36acd66622c891ad44

    and the sourcedoc is

    ?sourcedoc=%7BC5E89B4B-7F4F-4B36-ACD6-6622C891AD44%7D

    If you compare the two sections I've put in bold italics you can see they are the same number in a slightly different form.  So you could get the sourcedoc from the link and reformat it to create the new link you need.

  • Pstork1 Profile Picture
    68,717 Most Valuable Professional on at

    So evidently it is a timing thing.  I just looked at my demo environment again and there is a new property available when I get File properties called the document ID.  This property contains a link to the site's document ID redirect page and the ID of the document.  Using that as the link will redirect you to the file itself.  It should work even if you move the file inside the site collection.  But it took a while after turning on the Doc ID service before the property showed up.  So have your admins turn on Doc ID in a site collection, wait 24 hours and see if that property doesn't show for you also.

  • Verified answer
    syed_sme Profile Picture
    76 on at

    Thanks @Pstork1,

     

    I've asked Admin to check for me.

     

    In the meantime, I started looking at the way links are generated in the doclib and played around with the links a little. To my surprise adding the following to the end of my link opened the file in the browser.....

    ?csf=1&web=1

     

    I have no idea what ?csf=1 means but guessing &web=1 means top open in the browser?

     

    Anyway, just thought i'd share for reference.

     

    Many thanks again.

  • GeriR Profile Picture
    5 on at

    Thank you. Thank you. Thank you!

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard