PowerApps PDF Generator using Microsoft Flow PDF Converter
Вставка
- Опубліковано 5 вер 2024
- In this video, you will learn how to create a PDF using the power of PowerApps, Flow, and OneDrive. We walk through everything from generating the HTML, to filling in the variables, adding Flow actions, and finally sending content from PowerApps to the PDF. Very cool.
John Liu's original blog post on PDFs johnliu.net/blo...
W3 School's HTML guide www.w3schools....
PowerApps and Flow consulting www.PowerApps9...
Stop apologising about the video length, I am always happy to see the enthusiasm and passion of your learnings. The more, the merrier!
Awesome video again, Shane, great job!
Thank yoU!
i think i'm gonna dial 911
I know im asking the wrong place but does anyone know of a tool to log back into an Instagram account??
I was stupid forgot the login password. I love any assistance you can give me!
@Tyson Leonidas instablaster =)
@Davian Brayan thanks for your reply. I got to the site thru google and Im trying it out now.
Takes a while so I will get back to you later when my account password hopefully is recovered.
I have watched countless hours of CS and coding tutorials during my education and career, yours are by far my favorite. These PowerApps tutorials are an absolute lifesaver. Thank you!
You are very kind. 🐶
Just started working with Powerapps and Flow. Thanks to your videos I achieved a great progress.
Shane! Just by watching your videos I was able to program a power app to track absence times of our students. All teachers can now work together in that app and it saves them a whole bunch of time (AND PAPER!!). Thank you so much, rock!!
That is awesome! Good job to you Snork!
Good video, it really helped for my first application.
A few things I learned along the way:
- I used the "Compose" step to make the HTML more readable instead of directly entering it in the "Create File" step.
- If you can store the data you want to print in a Sharepoint list it makes it a lot easier to include dynamic variables in your HTML
Cool
I wish I could like this video twice. I was jumping and down with you when I got my company logo and my own custom power apps data out there!
Awesome!
"That took me...[Briefly reflects what day is it /damn I need to shower and sleep] I don't wanna talk about it." Nice work dude
Glad it helped and hope you remembered to shower. 😂
Another great informative video.
Top tip for avoiding having to do all that hard work with the concat expression in the single line editor... if you initialise another variable of type string and put all your HTML text in that, it is way easier to maintain and you don't need to concat any of it. Then you just drop the variable into the FileContent of your OneDrive Create File action :D
I like it. 😻
How would you accomplish that specifically?
my superstars to follow used to be Roger Federer, Guns N Roses, Tool, Megadeth, now the rockstars for me are Shane Young and Reza Dorani. Thanks, that´s just what I needed
Very kind of you. Hope you have a great weekend 🔥
I thought my enthusiasm for learning powerapps was weird. I feel you, bro. GREAT job, as usual. Thank you for your effort!
Yup 😻
thinking you were making this video in 2018... Awsome , thank you a lot for the sharing
I feel like I should make a new version but nothing has changed so 🤷♂️
Shanne you are awsome, you just can't imagine how much time you made us save. Please keep posting videos!
Glad to help. 😀
"You can choose any option you want, as long as it's PDF...Because that's the only option you have" :'D
😂
Hi Shane, just wanted to thank you for posting this video. I used your method for inserting a picture, except I tokenized the hmtl and then used replace() to add all of the pictures and elements. You're the best!!!
Cool
Shane, thank you so much for this and all the great videos that have made Power Apps truly accessible to me in my job. I was able to use a "Get Row by ID" function in the flow, add its output to my HTML, and get dynamic values from Dataverse (even LookUps) to populate in my PDF. Now I can export a PDF with all the Dataverse record's fields. So cool, and useful. Cheers!
Awesome 😎
Can you please show me how you managed filling in lookup records and data table fields in html. I am having issue with that.
Great video. I know I was struggling but I've learn a few things about a few limitation to take note of when desiging your html files for pdf conversion.
1. No flexbox or grid support.
2. Overflow doesn't work.
3. Body width has a max I've found 600px to be the sweet spot.
Thanks for sharing!
Awesome video Shane. Really does open up a lot of possibilities. One thing to add though, you can convert a word document to HTML which comes in handy when designing your document and then only needing to tweak a few things rather than having to write it all from scratch.
Yes but that creates a lot of extra “noise” in the html that is really scary to a newbie.
Hi Shane, Fantastic Video as usual. The length was necessary to convey each step with enough detail. I especially appreciated the Button to test the Flow. Looking forward to the next Video! Thanks.
Thank you Peter. 😻
Thanks Shane. Had a customer the other day that wanted this and u solved it for me so easy. Thanks
Glad to help. 😻
Hi Shane, I love it your video ...still my flow is not working but I could do it. Thanks for share yours knowledge. Thanks a lot.
Glad to help. 😀
Yo the trick to get the expression value got me out my chair like no waaaaaaaaaaay! nice one Shane! I was always a hover and type kind of guy! Not anymore!
Cool. Glad it works for you.
Brooo... Thank you so much for making our lives easier! This is very helpful!
Glad to help. 😀
It’s like you knew that I needed this video in my life :-)
I made it just for you. 😻
Once more, great video! I also must say that ive just started using Powerapp and your videos have been great as I dont know coding... Thanks a lot!!!!
Awesome 😁
@Shane Young, two years later ago you posted this video and I'm learning it now! :)
Awesome!
Anyone looking for a low tech work around can try this
1)On your powerapps screen select the gear icon and choose fit to screen
2) right click and choose print
3) choose save as PDF, then edit the layout
4) click the more Settings and choose the paper size and scale that will best fit your screen
5) uncheck headers and footers ( to disable all the annoying text and dates that will appear on your page from web printing)
6)check background graphics ( to show all your logos and images)
Then just save the file and you now have a perfect PDF replica of your screen.
Hopefully this saves someone the endless hours of frustration that I had to endure trying to print to PDF
Thanks
OMG you're a hero !!! And this Concat function is just perfect
Thanks 😊 glad it helped.
Thank you Shane, this is really helpful and easy to follow.
You're very welcome!
Dude you are the best! You make the learning process easier and enjoyable. keep the hard work!!
Thank you. I will. 😀
I love your enthusiasm! So in the end, you were able to insert only one input (the 9 cups of food) how would we make it to submit dozens of inputs in a table or form that I am making? Almost like an application to enter a program? Thank you appreciate any feedback!
Thanks Alan. This video should help speak to how we can get lots and dynamic data into the mix. ua-cam.com/video/bfXV_GXc_JM/v-deo.html
THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I was just trying to figure this out myself. You just saved me a TON of time!
Glad to help. 😀
Are you serious!? I was just chatting with you how I had done this with Sharepoint..." HA! Here you are with the video! Nice!
Interesting! I did this a bit different: PowerApps to Sharepoint to Word Template to PDF. Love how flexible these tools are!
Yeah I chuckled the other day. 😀
@@seadude do you have a tutorial on your method?
Another great useful topic...there are many times I need to create a dynamic filename (like with the date) and I am sure I could use Variable to create a string formatted the way I need and then Concat() to the rest of the filename.
Glad it helped. :)
This is incredible! I just created a new database and this will be something I add in the next version. Will definitely need to spend some time with this one lol!
Cool
that's great, it helped me a lot. can we just let it download directly instead of saving it to one drive.
I think you need to save it somewhere and download form there. Or email it to the user?
Hey Shane,
This was the missing link in a solution I am building for my schools (I help look after a whole district). You sir are awesome!!! You should set up a Patreon Page. I for one would support you.
That is awesome. I have toyed with patreon but I don’t know. 😀
@@ShanesCows You defo should lol
Excellent video content, easy to follow, great concept. I did, however, find what I believe to be a character limit on the expression field. I don't know the exact number, but my initial html code was too long to be valid. I did, eventually, get it to work after tinkering & removing several lines of code. Looking forward to more videos on PowerApps.
Interesting. Thanks for sharing. I haven’t ran into that yet but when I dig in on this project I will see what happens.
This is a great video thank you, Someone mentioned you had a way to also convert to Word? I need to create a dynamic template document based on Power Apps data/SharePoint. So looking to build a complete formatted word document in html with dynamic tables and then convert to Word. It seems easy enough in theory, but why is there no html to Word option - this seems more useful then pdf. Appreciate you thanks.
We haven't done it much here at PowerApps911 but when we have we have used the flow action Populate a Microsoft Word template and filled in the blanks. I have never went from HTML to Word. Maybe one of the 3rd parties like Encodian or Cloudmersive can do it? Not sure.
Hi Shane! this video was so helpful. I am able to create the HTML but when I convert to PDF and open the file I get a message that it doesn't have a preview and similar message when I download it to view. THANK YOU SO MUCH!
You have a typo in your html most likely. Thaw conversion is very grumpy
A.M.A.Z.I.N.G !! saved me hours of endless training, forever grateful ;)
Glad to help. 😀
You are awesome Shane. I love your videos!
Thanks 😎
Just stopped this to add a comment. Letter ‘x’ brilliant!!!!
Yeah the first time I saw it I wasn’t sufficiently impressed. Took a while to understand how good that trick was. Vivek showed me. 😻
That was worth watching, very helpful....
Glad to hear it!
great video! thanks so much for explaining every step! Great job!
You're very welcome!
Hey Shane, your videos are a real life-saver, thank you! I built a Flow just like in your video, but the PDF part of the OneDrive connector is still in Preview state (and probably will be forever) and my IT department wont let me put this into production. I looked into 3rd Party connectors, but we cannot use them because they're mostly American companies who dont comply with GDPR (PDF will contain sensitive company data). I'm now building an Azure Function which does just the same, what a hassle!
Bravo! Fantastic! Clear, concise, and cogent!
Thanks George!
Thanks, it helps me on one night crash course on power apps.
Cool
Hi Shane
My name is Marco and I'm writing from you from Sydney Australia. Firstly I want to thank you for these videos! I watched them all over and over again and I learnt powerapps. I use your techniques in my apps that I am creating. I watched this video many many times and the way that it converts a HTML to PDF using flow. My big dilemma is that my html is Landscape and Onedrive does not convert the landscape HTML to PDF. Would you know what I have to do ?
Anyway Shane I appreciate everything you have done for me and thank you so much. Ciao Marco!
Hi Marco. Best I know there is no way to set landscape. 😑
Shane thank you so much to have answered me. Looking forward to other Powerapp videos. God Bless ! Marco
Love these videos - fun, and super helpful every time! Can we meet Chewy some day? I mean thru UA-cam, of course.
Hi Carole he shows up in some videos. Or you email shane at www.PowerApps911.com and I will send you some pics. He likes the attention 😂😂😁
Shane Young I will keep watching videos - fun incentive to watch more, I might get to see Chewy! I need to teach my dogs how to build in PowerApps now...
Can you skip the HTML and send your collection into a table in an Excel template, then convert that Excel file to PDF?
I don’t know how to convert excel to pdf programmatically.
This is beautiful!!! Thank you so much for sharing this Shane!!
My pleasure!!
Sensei Shane,
Excellent tutorial I had been looking for a formula to create PDF from PowerApps for a long time. Now the question is: How can you send different data to fill the table? Example: Table (Record1 [, RecordA, RecordB]), Table2 (Record2 [, RecordC, ...])
My first idea is you would just have to send a variable for every field you want to populate. I think what I will figure out eventually though is you can send a bunch of data maybe comma separated to Flow and have Flow break it up for you. Not really sure yet. Ask again in a month when i finish the customer stuff.
Hello Shane, I want to convert data in my gallery (User Name, Comment and Comment Log Date) into PDF. I have followed the steps in the video above and have achieved it for text input. Any workarounds for this?
Great tutorial, thanks! Would you know how to turn left the pdf page?
I don’t 😑
Great!!! Now i can produce the invoices from my powerapp til now i did it with Access and ODBC on the database. Im happy! ;-) Thanks!
Glad to help. 😀
Very useful Shane as are all your videos. Thanks so much for sharing.
You are welcome. Glad it helped. :)
Awesome, that is exactly what I need for one of my projects! Thanks Shane!
This channel is so helpful!! Thank you.
You're very welcome!
Great Job Shane! Excelent videos! Thanks a lot!
My pleasure!
Thank you for the video. Everything works like a charm when I am logged in as the user that created the flow. The base files (logo, HTML, pdf) are all saved in the Share with Everyone OneDrive for Business folder. When I run the app/flow using a different account the flow fails on the getting the image file for the logo - says the resource cannot be found. That would be a permission thing right? But the file is in the Shared with Everyone folder and appears to open to all. Heck, I think they can even edit it. So, what am I missing?
The way I wrote this flow it is looking in the user who is triggering the Flows OneDrive for the file. :( Consider just hard coding the base64 in the flow or app like I talk about here. ua-cam.com/video/bIne3DD3HAg/v-deo.html One day I need to revisit these PDF videos. :)
Great content! Congrats Shane!
Thanks
That celebration at 23:57 was epic. Lol 😂
Thanks 😊
This is an awesome video. I think it'll be very useful for in the near future. Thank you so much Shane.
I love PDFs 😍
Thanks you! Nice video for starters!! In the example we are sending only one field value from PowerApps to flow. What if we want to send multiple field values from PowerApps to flow, how do we refer to those different values in the HTML.
Sorry I am slow. You will need to ask in Power Apps, inside your flow, multiple times.
2 silly questions:
1 - the OneDrive I am using is assigned to me, and only me. In order for this to work, do I have to give public access to one of the folders within my OneDrive to allow other users to run the flow?
2 - is it possible to execute a 'page break' command on the pdf?
1 it will save to their OneDrive. 2 page breaks are possible but I haven’t covered it yet. Requires fun with Div tags.
This is super cool. Dynamic PDF generation. Thank you.
Glad to help. 😀
Absolutely Awsome Shane, so well explained.
Thanks Clive 😁
Hey Shane. Thanks for the video. I've been using grids for layout in html. When running the code, the html file looks perfect but when converting to pdf, the file loses all the grids I've defined as well as any content within it. I've had similar issues with styling in general. It seems as though the conversion won't let me put in page numbers or align my image the way I want. Any idea why this might be lost in the conversion or know of anyone that might have the answer?
Sorry I got nothing Matthew
I’ve just run into this same snag. Did you ever find a solution, Matthew?
Shane, buen día. Realmente nos aportas mucha ayuda con tus videos de ejemplos y soluciones. Gracias!
I might have just missed something, but when I am creating the first file from HTML, it isn't coming through as a PNG file, and the converter is saying it wont convert. It is having me open it in notepad
Yeah, that shouldn't happen. I would run through the steps again or this video ua-cam.com/video/pFlwYy8ijiA/v-deo.html is a newer version of the same stuff. Might be helpful to hear me say it again, differently.
Hi Shane, I'm having problems with the "get file content" bit for the datauri string to convert my image (from SP) to something that can be inputted into my concat function.
I have a picture (jpg) in SP library so I use "Get File Contents" action as shown pointing it to my picture. I then initialise "photo" variable and set to string, use expression "dataUri('')" then select the "get file content" from the dynamic list like you suggest. It doesn't paste it in as "body('Get file content'), instead it puts dataUri('outputs('Get_file_content')?['body']'). When I hit "OK", it then says expression isn't valid. Any ideas?
I've also tried it with a OneDrive image file as well thinking it might have just been pesky SP, but it misbehaves too.
Any ideas?
Kathy I think you need one more ) at the end of the expression.
HI Shane, your video is very informative, could you please do a video on how to use this on Model Driven App, Thanks
Hmmm. I haven't thought about that. I will ponder that next time I am playing with Model. Hmmm
Shane, you are a saviour! Happy new year :)
Thanks Carol and right back at you. 😻
Hey Shane,
This is awesome...
Your videos are really helpful and very straightforward, Thank you so much of making these videos,
Can you please make a similar video to convert SharePoint List items to PDF
Thanks in advance. :)
You are welcome. I will see what I can do.
Nice one. This is very uselful
Glad it was helpful!
Great video once again Shane! I have a use case for this exact process; however, I need to embed the possibility of word, pdf, and jpgs. Any advice for this process with word or pdf docs?
I got nothing for embedding Word or PDF. Maybe look at the 3rd party PDF tools to see if they make it an option? Not sure.
@@ShanesCows I decided to convert all the docs into pngs whenever they are uploaded to the doc library. In your flow however you are utilizing OneDrive for Business (Get file content). I am utilizing the SharePoint (Get file content) when we set that equal to a variable and embed that intot our HTML should be expect those abilities to function the same?
For some odd reason my pdf is blank but my html file looks correct.
For the OneDrive convert file action. When I use the ID for the file in the Convert to pdf action. It create an empty file. When I use the path it says the id of the file is not valid.
*Edit:
I figured out my issue. You can't use flexbox or css grid. Have to use tables :(
Glad you got it. You are right the html is very picky what it will convert.
Hi Shane
Help please, I can't get around this. I created the flow in the power automate and when I do the test, everything runs fine, save the html in the onedrive folder and create the pdf file in the sharepoint folder as it is supposed to.
When I put the instruction on the button in OnSelect "htmlToPDF.Run (htmltext1.HtmlText), it stays underlined in red with the error message" Invalid number of arguments; 1 received, 0 expected ".
For now I am using the simple html "Table with border" without changing anything.
What am I doing wrong?
Thank you very much.
You forgot to Ask in Power Apps inside of you flow.
Hi Shane, thanks for the video. I have a slightly different scenario and am wondering how to get it to work. If a mail is send, I extract the html body and save it to onedrive. That part works. I then convert it to pdf and the images won't show up. Any idea how I can fix it? As I don't save the images separately each time an email arrives.
You are going to have to get the images in base64 format. So downloading the file and such. Not super easy, possible but not easy. Other thing you might check if the 3rd party PDF tools support URLs for images. I don't know if they do or dont.
How do I get landscape format on PDF file? Is there any programming in Powerapps? Has an html in powerapps with many columns. It creates PDF standing, and then not all columns appear.
Have to use a 3rd party converter to get landscape
Hi Shane. It is the steps missing for doing the HTML in the Flow. I would like to know next Video How to create SharePoint List(database) for PDF using the PowerApps method. Simple and logic which can be followed. thanks
I also need this ASAP huhu
Very helpful. Thank you so much.
Your are welcome 🙏
Great Job Shane!
Thanks
Thanks for your wonderful video, I got a lot of knowledge from your video. And for this topic, I have two question . Could I create file in SharePoint at first step when I create HTML context file? But I founded that there is no method to convert file to PDF from SharePoint directly, So if an apps need some people besides me to edit and generate a PDF file in SharePoint, where need to create html file at first? One drive only for personal I think, other people couldn't get access to edit. Could you give me some suggestion? The other problem is when I make a declaration for html file language is Chinese, but after file generated to PDF is mess code. So whether "html text "couldn't support Chinese language in Power Apps?
Thanks a lot.
OneDrive works. It will create the first file in each user’s own OnesDrive. No issue
@@ShanesCows So I don't need to share my one drive to others? I have tried to shared with my one drive give someone, she could generated a pdf documents but no detailed information only showed" Show HTML text....." .But if I click "export pdf" will be success! So I'm doubt about whether there is something wrong with one drive access.
Thanks for your kindly help.
Awesome as always😊 thank you for this info
Glad to help.
You mentioned you can do it with SharePoint? I didn't a see a convert to pdf for sp document libraries.
The HTML file and the conversion process has to happen on OneDrive. But the Create File step can create the file into SharePoint. Sorry for any confusion.
Thank you for your video. Your videos helped me alot to generate pdf from sharepoint list data. But image part is not working for me. I have stored my image file in one drive and used get content action to get image content , stored those to string variable and then added that to my string variable with html text as variable('Logo') .. steps you explained in this video, but it not showing me image on html as well as on pdf file. can you please guide me what can be wrong?
You must have a bug in your html. Try to simplify and try again.
Its all working fine but although i have a little problem. Unfortunately the pdf converter ignores the height an weight settings from my image within the image tag. Is there a way to fix this?
I feel like I have done the size stuff. Maybe try it as a style instead of inline.
So I have a question: can I merge pdf files without using paid connectors?
Btw, I really love this video! you make me learn a lot in a very easy way.
I don't think you can. I have always used paid connectors to merge.
Awesome tutorial.
I got error in 'Convert file using path step'. I use Sharepoint instead of OneDrive. In the 'Convert file using path', there is no option for Sharepoint, so I chose OneDrive. Then it shows 'path' (Sharepoint icon). Is this the reason cause error? If yes, what is the alternative way to 'Convert file using path' for Sharepoint?
Susan the file has to be in OneDrive to convert it. Then you can save it to SharePoint after you convert it.
Good video Shane. 1 question regarding the HTML code using the TriggerBody expression: why did u use the 'CreateFile Filename' syntax in the td cell?thx
So I could use the value pulled from Power Apps. Making things more dynamic.
@@ShanesCows thx. No what I meant by that Q is what if you have multiple text inputs from the user, so how would write/use different expressions to handle the multiple data going into the html rows to create the pdf? Rgds
Shane & Others, when creating the HTML to generate the pdf, I am struggling with the format for a multi-select box. So I have a box that the user can select 1-7 options. When I write the HTML as follows, I only get 1 value back. How do I write it to get all of them?
"&ArtifactV.Selected.Value&"
Thanks
.SelectedItems is the key. Check my other pdf video where this is covered.
It's cool! therefore you can bypass the word premium connector))
did not understand why the concat function was used
Ok, I am new to PowerApps and have been trying to solve a problem with no results. I am trying to convert html to pdf, but with dynamic pictures. I have everything running and the flow works, but it doesn't show the pictures and is a red X where the pictures are supposed to be. The flow use one drive to export the html file to one drive as you show here, but a dynamic picture doesn't work in my case as I need dynamic. I haven't found one person yet that has addressed this issue. Obviously it has something to do with datauri, but how do you solve this?
The key is you have to use the base64 of the image in the img tag. Details here ua-cam.com/video/bIne3DD3HAg/v-deo.html
awesome, it works, any chance i could get certain parts of the html to pdf to print out instead of the entire portion based on drop down selections inside the app? or is that too much?
Basically the conversion process just wants text, it doesn't care how you get there. So if you can create logic to only send part of the HTML you want then you should be fine. There is a newer version of this video that may help ua-cam.com/video/pFlwYy8ijiA/v-deo.html
Thank you very much this is exactly what I wanted! Awesome!!
Glad to help. :)
I'm using this with Power Apps but every time it store pdf to user's one drive account.
Any work around for centralized location for pdf?
The html file has to be users OneDrive. The pdf file you can create anywhere, like SharePoint
This works great for me but when users other than me try to use it they get an error saying "connection not configured for this service" . Any pointers would be great.
Do they maybe not have OneDrive accounts?
You have to predefine what will be in the pdf? You export a text input to the pdf , but what if I want to export a gallery or a collection? Would be more interesting I think..
Try this ua-cam.com/video/bfXV_GXc_JM/v-deo.html 😍
when I switch from manuel trigger to Power apps(v2) I don't get the option to ask power apps. What am I doing wrong?
This video explains it. Sorry they changed things ua-cam.com/video/vpjf5mD-COs/v-deo.html
Hi Shane - Thanks for the useful videos you have posted. I am able to run the canvas app using the power automate flow to convert the file to PDF as you have shown here but when I share this app this to my orgs users they are getting the following error "code": "InvokerConnectionOverrideFailed" "Failed to parse invoker connections from trigger 'manual' outputs. Exception: Could not find any connection for connection reference name 'shared_onedriveforbusiness' in APIM tokens header:" Any Suggestions Thanks
My guess is they don't have OneDrive of their own. The flow creates the file in the user's onedrive