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 Apps / Cannot Launch() a .url...
Power Apps
Unanswered

Cannot Launch() a .url from SharePoint Document Library

(0) ShareShare
ReportReport
Posted on by 119

Ran into an error today. I am unable to Launch() .urls from a SharePoint Document Library.

 

I have a gallery that allows users to select a document from the document library. The Onselect property is set to Launch(ThisItem.'{Link}', {}, LaunchTarget.New): 

powerUser1611_0-1649191351981.png

It is using ThisItem.'{Link}' to get the URL from the document's properties and then opens it in the browser. This always works for any file type. However, also in the document library are Links, which can be added from the Modern SharePoint experience. 

powerUser1611_1-1649191479186.png

Whenever you try to open one of these Links, the browser blocks it. It is likely due to the bizarre URL that is returned. 

powerUser1611_2-1649191572950.png

For these Links, instead of getting a functional URL, what is returned cannot be put straight into the browser. When you look at the {Link} for one of these records, you get the following:

 https://xxxsharepoint.com/:u:/r/teams/xxx/xxx/xxx/EHP%20Data%20Collection%20Resources%20Index.url

This cannot be opened in browser and will throw the error seen in the last screenshot. However, if you click on the Link from inside the SharePoint Document Library, it opens with the following link:

https://xxx.sharepoint.com/:u:/r/teams/xxx/xxx/xxx/EHP%20Data%20Collection%20Resources%20Index.url?csf=1&web=1&e=BEZcPv

 

With that parameter, the url works. But where did it come from? There is no documentation anywhere that allows me to dynamically reference this parameter. It only appears when the Link is clicked from inside the document library. If you pull the URL using Power Automate, there is no parameter either.

 

Does anyone know how to Launch() .urls from a SharePoint Library? Does anyone know how that parameter gets passed to the SharePoint .url when it is opened from the library?

 

I know this is a niche topic, but this question has been posed multiple times throughout the years with no answers. Thank you.

 

Categories:
I have the same question (1)
  • Verified answer
    powerUser1611 Profile Picture
    119 on at

    After digging around, I solved the problem. I'm posting the solution here in hopes that it helps someone in the future.

     

    When SharePoint generates a sharing link, it generates an extra parameter that is required to launch the .url "file type." You can see the differences between the 'Link' returned in Power Apps and the url that SharePoint generates below:

    Power Apps: 

    https://xxxsharepoint.com/:u:/r/teams/xxx/xxx/xxx/EHP%20Data%20Collection%20Resources%20Index.url  

    SharePoint:

    https://xxx.sharepoint.com/:u:/r/teams/xxx/xxx/xxx/EHP%20Data%20Collection%20Resources%20Index.url?csf=1&web=1&e=BEZcPv

     

    If this parameter string is not passed, SharePoint will not run the url correctly. So what is it and how can we pass dynamically in Power Apps? I found a blog post here showing a breakdown of SharePoint link structures and what they mean, and I based my solution off of this. 

     

    The Why:

    ?csf=1 is a parameter that is tied to the file sharing structure of SharePoint. It is added when sharing with 'People with existing access,' which is the default sharing setting of most SharePoint Libraries. This parameter is necessary.

    &web=1 tells SharePoint to attempt to open a file preview for the launched URL. While this could be a useful parameter for docx or pdf, it is useless for .urls, but for some reason it will not run without it. This parameter is also necessary. If it's removed, the link will not launch. Don't know why.

    &e=BEZcPv is a random string that is added on to the end of the url. No one seems to know why this is here, and it is random every time you generate a link. The good news is that it is not necessary. We can safely ignore.

     

    The solution: 

    Launch(ThisItem.'{Link}') returns https://xxxsharepoint.com/:u:/r/teams/xxx/xxx/xxx/EHP%20Data%20Collection%20Resources%20Index.url. We can append the necessary parameters to the end of this string by using this syntax:

    Launch(ThisItem.'{Link}' & "?csf=1&web=1")

    This will allow the url to run correctly. The only hiccup is that you get this intermediate page , which is SharePoint trying to generate a file preview. I don't know how to get around this part, but all you have to do is press "Open" and it will redirect you to the url.

    powerUser1611_0-1649253106433.png

     

    I hope this helps someone in the future!

  • Nguyenu Profile Picture
    6 on at

    I also have the same need. In my Sharepoint library I have both "office files" such as PPT, Excel and a URL link.

    When I create Gallery in Powerapp, it can open the office files nornally but if I click the item linked to the URL it will trigger a download screen instead. The syntax "?csf=1&web=1" above worked to open the intermedia page and we can click "open" to go to the url. But would love to know if there is any way to avoid the intermedia page. Thank you.

  • powerUser1611 Profile Picture
    119 on at

    @Nguyenu After using this solution for 6 months, I have not found a way to avoid the intermedia page 😣

  • Nguyenu Profile Picture
    6 on at

    I see... Thank you so much for your work around solution!

  • MPennick Profile Picture
    2 on at

    I'm a little late to the party but I found a way to get around it using a PowerAutomate flow on launch.  

    If(
     Lower(
     Right(
     ThisItem.'File name with extension',
     3
     )
     ) = "url",
    /*Item is a URL File*/
     Launch(
     'REPLACEWITHYOURFLOW'.Run(
     ThisItem.'Full Path',
     First(
     Split(
     ThisItem.'Link to item',
     ThisItem.'Full Path'
     )
     ).Value
     ).urlvalue
     ),
    /*Item is a locally hosted file*/
     Launch(ThisItem.'Link to item')
    )

     Then the flow > 

    MPennick_0-1686758247811.png

    where the return urlValue is 
    last(split(base64ToString(outputs('Get_file_content_using_path')?['body']['$content']),'URL='))

    The SiteAddress variable could be skipped but I was trying to make a flow to fit in 2 different apps that both had the same issue with URLs in document libraries.  

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard