Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Dynamically Display PDF name based on passed context

I am trying to pass a context variable with a PDF name to a PDF viewer screen to display a PDF (dynamically based on the variable passed). It is not working. Here are some screenshots.


Screenshot 1: initial screen passing context variable via "Navigate" function:



Screenshot 2: Next screen (where "Navigate" goes to), with p_file context variable displaying as text at top of the screen



Screenshot 3: Same screen showing "Document" function for PDF Viewer with static text -- this correctly displays the PDF (text matches the p_file variable from previous screenshot)



Screenshot 4: Same screen but "Document" has been changed from static name of PDF to p_file (which contains the same "string") and the PDF no longer displays.



So in conclusion, I'd love to be able to use a single screen to dynamically display PDFs based on their name -- instead of having to create a million different screens and display PDFs using static string names.  Is this possible?


Side note: I really would like to be able to view PDFs that are stored on SharePoint, instead of within the app, but that has already been well documented and has been "Planned" for development for an exceedingly long time already.


Session ID: a4036cc8-8a02-e95e-a822-ae61554637b0
PowerApps 2.0.730


Level: Powered On

Re: Dynamically Display PDF name based on passed context

As an update, when I publish the app and run it, the PDF does not display in the viewer regardless of whether I hardcode the PDF name or use a context variable.


Tested using a surface pro and iphone.


It is really quite unfortunate that the PDF viewer is essentially useless.  I show executives a prototype and they LOVE it, but without being able to display PDFs, the solution is useless.

Community Support Team
Community Support Team

Re: Dynamically Display PDF name based on passed context

Hi @grhaberer,


Variable works from my side:




I think the issue here should be the value of the Variable.

From your screen, it seems that the Variable is collecting the string, not the corresponding name of the PDF file.

Which should be similar to the issue in the following thread:

Image and list


To workaround this, please consider to create a collection to hold the name string and the corresponding PDF name (the file, or the URL), then use the lookup function to match the corresponding PDF file.




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

Helpful resources


Power Apps Super User Class of 2020

Check it out!


New Badges

Check it out!


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,109)