Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

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


Frequent Visitor

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
Community Support

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

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

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.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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