Show PDF files from SharePoint in PowerApps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone this is krishna vandanappu a business applications mvp welcome to my channel in this video i will be discussing about how to show a pdf file from sharepoint document library to powerapps pdf viewer control with the help of power automate let us see what are all the steps we should follow to render the pdf in powerapps seamlessly irrespective of the content inside the pdf i have logged into powerapps maker portal now the business requirement is i have a sharepoint document library in this document library i have various pdf documents and each and every document has a different data what do you mean by the different data when i go to bp health i have all the data in plain text and when i go to this pdf especially this pdf i have something in non-english format so i want to ensure that any of this pdf user want to see in power app that should render seamlessly let us see how we can implement that first thing first i am adding the document library as part of the data source i have all my documents as part of this documents library and now i'm adding a vertical gallery and providing the data as my document library and i'm changing the layout from title to title and subtitle and here i'm going to say as filename with extension now i know all the files i see that there are files which are non x non-pdf as well so as part of this i am going to say filter document type as equal to pdf now the time i say i see only the pdf files now i'm going to use out of the box pdf viewer control to render all these pdf controls now i have added this pdf viewer control and if you see the document which shows as sample pdf now what i wanted to do is i wanted to pass the selected pdf file to the pdf viewer control and see how it will render that is the main objective now how i can do that is either i can say gallery one dot selected file dot file name with extinction which is the default property but i see that make sure the pdf file is coming from an http link okay let me add one more label to see what i am getting as part of this now i want to say that gallery one dot lookup documents comma id equal to gallery one dot gallery one dot selected dot id comma link to item so this will show me the complete http s path okay let me say that to this item property and see if that works even that is also not showing me the data and after a while it is giving me error message as could not open pdf file open in my browser instead which means that doesn't matter user which document user selected now i click on this it is opening in the browser but i don't want that to be open in the browser i want to render here as part of this pdf control how i can do that is i have to create a flow to render the data in this control i logged on to microsoft flow and i'm creating a instant flow click on the instant pro now i'm going to get the data from powerapps so click on powerapps i'm going to name this as render pdf file data create now i am going to read two parameters from power apps one is what is my site address and what is my file path now i am going to create two variables say variable initialize a variable first one is f site address because i need to connect to the site this one and this one is i'm going to rename this as where site address this one i'm going to ask from powerapps site address and the next one is the file path i'm going to create one more variable as initialize variable where file path this one will have file name and also document library name this one is also coming from powerapps so now i have both file name and file path which is going to be what is my sharepoint site address and what is my document library path and the file name so that one i now that i got this and i know my data is coming from sharepoint i'm going to create a connector from sharepoint and this time i'm going to get the file using get file content using path the first one will be what is my uh parameter my parameter is going to be custom value i'm going to say my site address value is here and the file path value will be file path value now i have got the file path and the file site address also it will read the data from sharepoint document library and it will have all the data as an output now let us rename the action as get pdf data and now i need to send the data back to powerapps now powerapps respond to powerapps or flow select the return type as a file and here i'm saying for pdf content and here i need to send the data whatever i get as part of this step how do i do that is i'm using expressions body of this now remove the body out of this what i need is the content out of this output i don't need the entire stuff all i need is out of this output from this previous step body and inside the body all i need is content that is the only text we need to send back to powerapp now that our flow is ready let us go back to powerapp and include that flow as part of our powerapp so when we wanted to call that flow is as soon as user click on this next icon here what i wanted to do is i want to insert action power automate and our flow name is render pdf data select render pdf data so render pdf data expect two data parameters to flow one is the site address and other one is file path to get the site address what we need is gallery one dot selected dot link to item is something what we see as part of this label so which means that i am getting the complete path out of this what i need is i i need up to practice because sharepoint documents is the document library name and the next one is the file name if i see what is gallery 1 dot selector dot full path i get the document library name without special characters now i need to replace remove this from this complete text so what i'm going to do is first i need to replace this percentage l20 with a space now we have the complete text without the special characters it's complete link without special characters now we need to remove the folder path from this with blank how do i get that is gallery one dot selected dot full path this will give me the site link let me show you what i will get here if you see here i'm getting sharepoint site url i can as well hard code it i want to show how to get the sharepoint site url dynamically now i got one first parameter site url the next parameter is folder path which we know very very well gallery one dot selected dot full path so i got both the parameters parameter one as a site url and the other parameter is document library path but my flow is sending a return type read the return type at the powerapp level what i need to do is i need to assign the return type to another variable so i can render as part of my pdf control so now that i know i got the return type as where pdf go back to this now the document is going to be where pdf dot pdf content because my parameter name is pdf content that will hold my file content let us see how this will function so i click on that s is invoking my flow and i got the data back now let us see how the non-english pdf will work there you go so which means that my pdf reader is absolutely working the way how it's supposed to work irrespective of the data what i have as part of my pdf i'm able to see as part of my pdf viewer component [Music] the tip of today's video is while you're creating flow always add a comment to understand what this action of the flow is doing now i will say this is to get the file content from sharepoint library so what happens is tomorrow when somebody comes and see look at this flow they will be able to understand what this step is all about in fact as part of the step i can write the formula also now i have added a expression here i can write the expression here so that what i have used the expression as part of this step will be easily understandable when we are looking so this way my maintainability of the flow is very easy i hope this tip is helpful for you guys while you are creating flows this is my contact information if you like the video please add your comments hit like subscribe to my youtube channel for all future videos thank you have a nice day
Info
Channel: Krishna Vandanapu - MVP
Views: 33,802
Rating: undefined out of 5
Keywords: Show PDF files from SharePoint, Power Apps, PowerApps PDF control, View PDF in PowerApps, PDF in PowerApps, PDF using PowerAutomate, PDF component, powerapps pdf viewer, powerapps pdf, powerapps pdf generator, powerapps tutorial, power automate tutorial, powerapps tutorial for beginners, json tutorial for beginners, JSON function in PowerApps, powerapps gallery, Power Automate, Show pdf files form sharepoint
Id: ut0g7hsWoC4
Channel Id: undefined
Length: 13min 5sec (785 seconds)
Published: Mon Dec 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.