Solved! Go to Solution.
@CuriousJ wrote:
Hi Brian,
I have below error when adding the variables to powerapps. Not too sure where I did wrongly. Pretty new to the powerapps and flow. Maybe you could share some insight. Thanks.
I have correct the code in OnVisible property on the second screen in the app as it should have actually referenced the original document file name and not "._dlc_DocIdUrl_Description" (my bad ).
The correct code for the OnVisible property should in fact be as follows:
UpdateContext({ loading_v: true });
UpdateContext({
pdf_v: 'PowerApps-GetPDFdocument'.Run(
Concatenate( First( Split( selecteditem_v.Name, ".") ).Result, ".pdf")
)
});
UpdateContext({ loading_v: false })
The purpose of the "Split" function used in the code above is to remove the file name extension of the original document name and thereaafter replace it with a ".pdf" file extension name.
Hope that solves the issue you were experiencing.
I have updated that blog with the correct code as well.
Hi @CuriousJ ,
Do you want to preview the PDF files stored in your SP Library?
If you want to preview the PDF files stored in your SP Library, I afraid that there is no direct way to achieve your needs in PowerApps currently. The PDF Files (or any other files) stored in a SP Library is required to authenticate, but if you want to preview PDF files in PDF Viewer control, the server that hosts the document must not require authentication.
Please check the limits in PDF Viewer control, please check the following article:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-pdf-viewer#limitations
As an alternative solution, I think the combination of PowerApps and MS Flow could achieve your needs. Please check and see if the following blog and video resources would help in your scenario:
https://masteroffice365.com/viewing-pdfs-from-sharepoint-within-powerapps/
https://www.youtube.com/watch?v=NTp77benqfQ
Please take a try with above solution, then check if it could help in your scenario.
Best regards,
Hi @CuriousJ ,
Please go to your flow's history, then check if the flow returns a proper PDF File content back to your app.
Best regards,
I wrote that blog and I am curious how many App Makers out there tried the "hack" I used asa for me at least it appeared to work consistantly well with any PDF document I wanted to view based on that Flow.
Having said that, subsequent to writing that blog I have been working on an "awesome" demo app that amongst many other things demostrates a technique to view any PDF document in SharePoint in 100% totally supported ZERO HACK method <grin> by running a single Flow not multiple times for say each PDF document in a folder in a Document Library but just once for all PDF documents in that single folder. Based on the technique I leveraged in my upcoming blog, my personal personal opinion is that PowerApps team may well finally have a fully supported method to finally enable this functionality natively within PowerApps (if they not already working on it...).
A few weeks ago I posted a teaser / prototype demo of the type of functionality this demo app implemented with just one screen can do:
Watch this space - within the next 2 weeks latest.
Hi @CuriousJ,
Further to checking if the Flow did successfully run, should you find it didn't even attempt to run, I'd suggest removing that Flow from the app and then add it again and test again.
Please share your findings, perhaps I can help further with more details.
Regards,
Brian
Based on your screenshots it would appear the problem lies in your PowerApp and not with the Flow. I'd also suspect that there is nothing wrong with any of your code on the second screen.
I'll need to retest the code because the way in which I populated the rows in my own gallery was actually using a Flow that returned the "._dlc_DocIdUrl_Description" property of the document. In which case in the next couple of days I'll update that blog in the next few days that details the first Flow I used to populate my Gallery with the PDF documents stored on your SharePoint Library...
@CuriousJ wrote:
Hi Brian,
I have below error when adding the variables to powerapps. Not too sure where I did wrongly. Pretty new to the powerapps and flow. Maybe you could share some insight. Thanks.
I have correct the code in OnVisible property on the second screen in the app as it should have actually referenced the original document file name and not "._dlc_DocIdUrl_Description" (my bad ).
The correct code for the OnVisible property should in fact be as follows:
UpdateContext({ loading_v: true });
UpdateContext({
pdf_v: 'PowerApps-GetPDFdocument'.Run(
Concatenate( First( Split( selecteditem_v.Name, ".") ).Result, ".pdf")
)
});
UpdateContext({ loading_v: false })
The purpose of the "Split" function used in the code above is to remove the file name extension of the original document name and thereaafter replace it with a ".pdf" file extension name.
Hope that solves the issue you were experiencing.
I have updated that blog with the correct code as well.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
209 | |
194 | |
82 | |
58 | |
38 |
User | Count |
---|---|
303 | |
249 | |
120 | |
83 | |
55 |