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 / Directly opening a PDF...
Power Apps
Unanswered

Directly opening a PDF file from PowerApp

(0) ShareShare
ReportReport
Posted on by 602

Ive got an App based on a SP List which contains a PDF file and I want to open that file directly through the app

Ive set up a gallery based on a list of materials and suppliers.

 

In the SP list there is a colum called Attachements and when I add the DocumentPDF icon to my gallery I want it to open the attachement in the sharepointlist based on ItemSelected

 

Categories:
I have the same question (0)
  • uwenagel Profile Picture
    382 on at

    You may think of a flow that is started by a button that gets the attachment of the item selected and saves it to a predefined place in a SharePoint library. Of course you have to pass the ID of the selected item to the flow.

     

    You could then show the file with Launch( Url to saved document ) which opens the PDF in the standard application.

  • uwenagel Profile Picture
    382 on at

    You can also Launch the attachment directly. The Url would be the following:

     

    https://YourDomainName.sharepoint.com/sites/YourSiteName/lists/YourListName/Attachments/ListItemID/AttachmentFileName

     

    If you construct that Url from the selected item you could put that string into the Launch function (triggered by a button or appropriate) which then opens the PDF in the standard application.

     

    If you like this post give it a thumbs up or mark as solution.

  • RvdHeijden Profile Picture
    602 on at

    @uwenagel thanks for your help so far

     

    My problem is that the PDF file is an attachement which I must download first in order to open it, I can't directly open it from the list. I've tried to get an URL from it but then it returns a location within my download folder c:/Users/myname/downloads/303493%20 ......

  • uwenagel Profile Picture
    382 on at

    You do not have to download it first! Look to my previous post. You can construct the Url with your site name, your list name and the ID directly to the attachment file as shown before.

     

    Launch() will then open the file directly.

  • RvdHeijden Profile Picture
    602 on at

    How do you integrate the ListItemID into the URL ?

    Launch("https://company.sharepoint.com/sites/company/projects/FttH/Lists/Materiaallijst/Attachments/thisitem.id/attachementfilename")

     

    I understand what you are trying to do but can you help out with the last part ?

  • uwenagel Profile Picture
    382 on at

    Each item in the list has an ID. If you don't see it in the view you may have to include it there. Also it is normally available in the record selected in the gallery when you have a list as the source of the gallery (or a collection based on the list).

     

    So you should do the following:

     

    Launch("https://company.sharepoint.com/sites/company/projects/FttH/Lists/Materiaallijst/Attachments/" & ThisItem.ID & "/attachementfilename").

     

    Of course, you have to know the file name of the attached file. If not you may first start a flow that is returning the name of the file and include it in the call.

     

    Please check your Url as well as it contains the following part:

     

    .../sites/company/projects/FttH/...

     

    From that it is not clear to me what your site name is. I assume it is a projects site then the Url part would be the following I guess:

     

    .../projects/FttH/...

     

    Hope this helps.

     

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard