cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GeriRichter
Advocate II
Advocate II

Launch links from SharePoint Document Library

Hello,

I have a PowerApps form that accesses a SharePoint document library. That library contains:

  • Documents
  • Links to documents in other libraries on the SharePoint site
  • Links to external websites

I would like to make it so that if you click on an item in the PowerApps form, it opens the item as if you had clicked it in the library.
I tried setting OnSelect to: Launch(ThisItem.'Link to item'), but that only works for documents that are actually located in the library. For links to docs in other libraries or links to websites, it instead tries to download the url to the link item in the list, not launch the document or website that it points to.

Is there a way to get and launch the url that SharePoint would launch?

Thanks!



1 REPLY 1
StevePenner
Helper I
Helper I

I created a test doc lib in SP with 3 items. One was a regular file (content type Document) that was a PDF, and one was a "Link" that comes with the modern experience menu. I also changed the doc lib to add the content type "Link to a Document" which was part of the classic experience doc lib in other SP versions.  Then I started a canvas app "Test" connected to the SP doc lib "Test" and it immediately created a Browse Gallery with the 3 items. I changed the cards in the gallery to show only the file name in the Doc Lib, and I changed the OnSelect property to your Launch() function code. When I clicked the items holding the Alt key down, the browser came into the focus with a new tab for the PDF file (as you would expect) and for the Link To A Document content type (the ASPX file link), but the .URL type showed a warning about a harmful file and did not open the page.

 

You may need to reference another column or build a URL from the item fields in order to use the Launch() function.

 

Untitled.png

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (39,810)