cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

PowerApps SharePoint Attachment PDF

Hello,

 

I have PowerApps gallery which the data source is from SharePoint and each item got their own attachment in PDF format. Is it possible to view the attachment in the PowerApps in PDF viewer?

 

Thanks.

 

Regards,

Nik

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: PowerApps SharePoint Attachment PDF

Hi @nikfikrie92 ,

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:4.JPG

 

Please check the LookUp(Gallery1.Selected.Attachments,DisplayName = "PDF File.pdf").Value formula could return a proper result looks like below:

appres://datasources/20190325_case13/table/b34320dc-c867-4df9-a543-cd9fe16ed81f/rows/1/reference/https:%2F%2Fasia-001.azure-apim.net%2Fapim%2Fsharepointonline%2F627bfba80bae4e8e899df7a03b3195bb%2Fdatasets%2Fhttps%25253A%25252F%25252Fxxxxx.sharepoint.com%25252Fsites%25252FPowerApps%2Ftables%2Fb34320dc-c867-4df9-a543-cd9fe16ed81f%2Fitems%2F1%2Fattachments%2F%2525252fLists%2525252f20190325_case13%2525252fAttachments%2525252f1%2525252fHTTPS-FAQ.pdf%2F$value

Also please check if the selected item in your Gallery contains a attachment file whose name is 'PDF File.pdf', if not, the PDF Viewer control would display empty.

 

You could consider add another Gallery (Gallery2) within your app, then set the Items property to following:

Gallery1.Selected.Attachments

then within the Gallery, add a Label control, set the Text property to following:

ThisItem.DisplayName

then the Gallery2 would show all available PDF files attached to the selected item in your Gallery1.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Dual Super User III
Dual Super User III

Re: PowerApps SharePoint Attachment PDF

Hi @nikfikrie92 

 

You can achieve that by using the below formula:
 
LookUp(Gallery1.Selected.Attachments,DisplayName = "PDF File.pdf").Value
 
Here, Gallery1 is the name of gallery control. Highlighted part contains the name of  Pdf file.
 
If you just have one attachment pdf attached to the item, then you can also use:
 
First(Gallery1.Selected.Attachments).Value
MicrosoftTeams-image (201).png

 

Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Highlighted
Advocate I
Advocate I

Re: PowerApps SharePoint Attachment PDF

Hi @yashag2255 ,

 

Thank you so much! It work for this formula 

First(Gallery1.Selected.Attachments).Value

 

But it doesnt work when I used LookUp(Gallery1.Selected.Attachments,DisplayName = "PDF File.pdf").Value

It just displays a blank pdf. What does DisplayName = "PDF File.pdf" refer to? Does DisplayName refer to my column or I need to change something on "PDF File.pdf"? Can you help me verify this?

 

Thank you so much!

 

Regards,

Nik

Highlighted
Community Support
Community Support

Re: PowerApps SharePoint Attachment PDF

Hi @nikfikrie92 ,

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:4.JPG

 

Please check the LookUp(Gallery1.Selected.Attachments,DisplayName = "PDF File.pdf").Value formula could return a proper result looks like below:

appres://datasources/20190325_case13/table/b34320dc-c867-4df9-a543-cd9fe16ed81f/rows/1/reference/https:%2F%2Fasia-001.azure-apim.net%2Fapim%2Fsharepointonline%2F627bfba80bae4e8e899df7a03b3195bb%2Fdatasets%2Fhttps%25253A%25252F%25252Fxxxxx.sharepoint.com%25252Fsites%25252FPowerApps%2Ftables%2Fb34320dc-c867-4df9-a543-cd9fe16ed81f%2Fitems%2F1%2Fattachments%2F%2525252fLists%2525252f20190325_case13%2525252fAttachments%2525252f1%2525252fHTTPS-FAQ.pdf%2F$value

Also please check if the selected item in your Gallery contains a attachment file whose name is 'PDF File.pdf', if not, the PDF Viewer control would display empty.

 

You could consider add another Gallery (Gallery2) within your app, then set the Items property to following:

Gallery1.Selected.Attachments

then within the Gallery, add a Label control, set the Text property to following:

ThisItem.DisplayName

then the Gallery2 would show all available PDF files attached to the selected item in your Gallery1.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Advocate I
Advocate I

Re: PowerApps SharePoint Attachment PDF

Hi @v-xida-msft ,

 

Thank you, I use 

 

LookUp(Gallery1.Selected.Attachments,DisplayName = DisplayName).Value

 

Then It works like a charm. Because I don't want to specify the PDF document to any specific name.

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

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

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (4,696)