Over the summer I built an app that was easily able to display a PDF stored either on OneDrive or SharePoint by creating an app that loaded the file as a blob into a Context Variable as a Blob. It worked perfectly by referring to the context variable
Many months later, I am trying to use that technique and it isn't working. Does anyone know if support for this technique is no longer available? The file is stored on my OneDrive and this should be simple.
Thanks,
I gave up for the moment although I have enlisted the help of a variety of Microsoft resources including the support channel and others in the product team to answer the central question of how to correctly display a PDF stored in OneDrive in the PDFViewer control.
I developed a workaround by:
Definitely "going around the block to get next door" but in the end it is probably a better design and will minimize runaway "intermediate" or dated versions of the printed document accumulating in the OneDrive folder.
I don't have time to solve the original question as it stands which remains, "can one display a PDF stored in a OneDrive or SharePoint Document library in a PDFViewer control?" I just don't know but hopefully, someone with deep product knowledge can answer that question. In the meantime, I have an effective workaround, and perhaps a better overall design.
I probably could have also gotten an Azure Storage account and used it to store the PDF temporarily to display it but that would be even clunkier and heavy-handed, plus my client hasn't committed to any Azure usage so far so that would have meant a lot of other lengthy discussions that I wanted to avoid.
My only fear is that I have been using the PDFViewer control now for just about 4 years and it is still classified as "Experimental" . This approach, syntax and usage is not sanctioned in the documentation
as a supported input to the Document property. That states that the input to the Document property of the PDFViewer control is supposed to be only a direct https:// link to an unsecured URL with no redirects. I worry that 6 months ago from now something will change and suddenly this won't work then like my solution from 6 months ago doesn't work now but I will cross that bridge when I get to it. In the meantime, this looks like a pretty stable workaround but we will see as we test it with some 100 users or so.
Here is the OnSelect code that runs on this button
UpdateContext(
{
pdfobject: 'CreateWordPDFQuote-outsideofsolution'.Run(
"FGSO-1143",
"testfilefromAppOutsideSolution"
)
}
)
Here is the Flow that is called (all that is missing is the initial PowerApp Init step).
And here is the money steps at the end expanded (ignore the pdfURL - that is just and experiment that isn't working)but everything else is correct.
Here is context variable in PowerApps
And here is the contents of pdfobject after I run the flow.
Here is the OneDrive folder that contains the file:
And here is a sample PDF quote that I am generating:
As I said, I had this design pattern working perfectly over the summer and now that I actually need it to work as a "last mile" feature, I am stymied.
Thanks for your help.
What is your formula for defining the pdfobject variable?
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional