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?
Solved! Go to Solution.
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.
Best regards,
Community Support Team _ Phoebe Liu
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.
Best regards,
Community Support Team _ Phoebe Liu
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.
As you can see, the word AbsoluteUri is underlined with red. Same with pdf viewer Document propriety
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
Please help thanks !
First(Gallery1.Selected.Attachments).Value
First(Gallery1.Selected.Attachments).Value
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
272 | |
257 | |
87 | |
39 | |
34 |
User | Count |
---|---|
348 | |
257 | |
130 | |
68 | |
48 |