cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
akorejwa
Frequent Visitor

How to use pdf viewer to view a pdf attachment in a list

I have a sharepoint list which may have multiple attachments associated with each item. Among these attachments, there will *always* be one for each item which will be useful for people in the field to view. I created a screen which displays some meta data and all attachments associated with the list item. However, I would like the user to either be able to select one of these and view it, or simply view the pdf that will be useful to people in the field (selection of the correct pdf attachment could be controlled by the name of the pdf perhaps?). There does not seem to be a 'onSelect' option for the attachments in the form that displays them.

How can I use pdfViewer to view a pdf attached to an item in a list?

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @akorejwa ,

I've afraid it's not supported to make this currently in PowerApps.

For now, you could only set the PDF viewer's Document to the PDF's link directly.Server redirects or HTML views of the document aren't supported. For example, set the Document to Gallery2.Selected.AbsoluteUri, it will not display PDF successsfully.

Here's a doc about PDF viewer for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-pdf-viewer

As an alternative way, I suggest you use the Lunch function.

Set the gallery's arrow's OnSelect: Launch(ThisItem.AbsoluteUri)

Then, if user click on the arrow, it will open PDF file in webpage automatically.742.png

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
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

5 REPLIES 5
v-yutliu-msft
Community Support
Community Support

Hi @akorejwa ,

I've afraid it's not supported to make this currently in PowerApps.

For now, you could only set the PDF viewer's Document to the PDF's link directly.Server redirects or HTML views of the document aren't supported. For example, set the Document to Gallery2.Selected.AbsoluteUri, it will not display PDF successsfully.

Here's a doc about PDF viewer for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-pdf-viewer

As an alternative way, I suggest you use the Lunch function.

Set the gallery's arrow's OnSelect: Launch(ThisItem.AbsoluteUri)

Then, if user click on the arrow, it will open PDF file in webpage automatically.742.png

 

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
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

Hi @v-yutliu-msft ,

 

I'm new to power apps and I try to create an app based on some shp lists.

I have a shp list named receptions and it contains info about invoice details and product detalis and I also add pdf file to attachments column. On my screen I have a data table showing the info from my list, a gallery and a pdf viewer. 

What I want, if it is possible is if the user click on a data table row, pdf viewer should show the attachment it has. Even now I didn't find it how to do this, and I tried using a gallery. I've done what you said but it seems there is an error and I don't know how to solve it.

MF_powerapps_1-1604409712781.png

As you can see, the word AbsoluteUri is underlined with red. Same with pdf viewer Document propriety

MF_powerapps_2-1604409803324.png

 

What am I missing.

 

Please keep in mind I am a total noob in this so a tutorial on how to work this out is greatly appreciated.

 

Thank you!

 

@v-yutliu-msft , I think I found a way but it didn't fix my problem

 

I corrected the formula, and now it's working but it doesn't open into my pdf viewer but it opens a new tab in chrome showing the attachment. See image bellow 

MF_powerapps_0-1604411367128.png

Please help thanks !

  

Pramud
Frequent Visitor

First(Gallery1.Selected.Attachments).Value

Pramud_1-1612251744747.png

 

Pramud
Frequent Visitor

First(Gallery1.Selected.Attachments).Value

Pramud_0-1612251682061.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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (12,573)