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.

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})}})

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.


