Requirement: Generate PDF from Power apps and save PDF file in SharePoint document library through Power automate
Create a Blank canvas app, add label and vertical gallery to the screen. Add data SharePoint list “Leave Request” to the power apps.
Create a power automate flow from power apps, Select Power apps(V2) as Trigger. And Create file as an Action, add site address, folder path,
File name:
triggerBody()[‘file][‘name’]
File content from dynamic content. Name the flow as SavePDF.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-15.png)
Add PDF icon to the gallery for saving and make the screen as pdf file in SharePoint document library.
PDF Icon- OnSelect property:
SavePDF.Run({file:{name: "Leave Request.pdf", contentBytes:PDF('Home Screen',{ExpandContainers:true})}})
![](http://rishandigital.com/wp-content/uploads/2023/05/image-14-1024x630.png)
Now go to the Preview button and click on PDF icon then the flow run successfully and the file is added to the SharePoint document library.
![](http://rishandigital.com/wp-content/uploads/2023/05/image-16.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-17.png)
![](http://rishandigital.com/wp-content/uploads/2023/05/image-19-1024x514.png)