Power Apps: Add a "Open in Sharepoint" button to a gallery

Updated: May 25, 2024
Table of contents:
The topic: Add a "Open in Sharepoint" button to a gallery

You often want to display Sharepoint documents in a Power App. And this can be done very easily by adding a gallery and selecting the corresponding Sharepoint library as the items. Opening the document is then also very easy by adding a button or icon within the Gallery and adding the following formula to the OnSelect:
Launch("https://XXX.sharepoint.com/"&ThisItem.'Full Path')But what if you also want to make other document actions available to users? For example, “Duplicate document”, “Send document by e-mail”, “Rename document” or “Download document”. We could recreate all these functions in Power Apps, but we all know that these functions are actually already available in Sharepoint. For this reason, a solution is shown below on how to display the document from the Power Apps Gallery directly in Sharepoint with an “Open in Sharepoint” button, similar to the one in Microsoft Teams.
The solution in a nutshell
Add a button within the gallery and name it “Open in Sharepoint”, for example. Then add the following formula to the OnSelect property:
Launch("https://XXX.sharepoint.com/SharepointDocumntLibrary1/Forms/AllItems.aspx?useFiltersInViewXml=1&FilterField1=ID&FilterValue1="&ThisItem.ID)Now all you have to do is replace the yellow highlighted areas with your Sharepoint address and your Sharepoint library. And then you can give it a try.
The link does nothing other than open Sharepoint and filter on the “ID” field of the selected document. Since the Sharepoint ID column is unique, there will only ever be one hit and therefore display exactly this document.
Incidentally, you can also filter on any other Sharepoint column by adjusting the Filter1 part of the formula accordingly. Have fun!
Do you like this article?
Please write a comment or leave a like below and follow me on LinkedIn.
If you have any questions, I'm happy to help.
Marc Sigrist (Powerfully GmbH, Switzerland)






Really helpful article! I especially liked how you covered the smaller details instead of just focusing on the usual Path of Exile 2 headlines. It gives players a better idea of what to expect before launch. I've also come across a few mentions of POE Currency and POE 2 Currency, but I'll wait until the game is released before looking into them further.
Really good post! I liked that you covered some of the smaller details instead of just going over the usual Diablo 2 news. It gives players a better idea of what to expect before launch. I've also come across a few mentions of Diablo II: Resurrected Runes, Diablo II: Resurrected Items and Diablo II: Resurrected Gold, but wait until the game is out before looking into it.
Really helpful article! I especially liked how you covered the smaller details and explained what players should pay attention to ahead of GTA 6's launch. It's nice to see more than just the usual headlines. I've also started looking into options for GTA 6 Money, so having a better understanding of what's available is useful.