Latest Posts

PowerApps Export data to PDF


In this article, we will see how we can export data from canvas app into PDF format with the help of Power Automate.

We are going to keep the example very simple. You can extend for your requirements.

Power Automate Flow to Create PDF file

  • First, we’ll create a Power Automate Instant flow.
    PowerApps Export data to PDF
  • Give proper name to the flow. The trigger type will be PowerApps.
    PowerApps Export data to PDF
  • We are going to take the input from PowerApps (Canvas App), Select an input type (String/Text).
    PowerApps Export data to PDF
  • Next Step: Add Create file action as shown in the screenshot.
    PowerApps Export data to PDF
  • Specify Folder Path (Path where file will be created), File Name (Name of the file) and File Content (Content of the file which is passed from the earlier action).
    PowerApps Export data to PDF
  • Next Step: Add Convert File action. For File, specify Id from the previous action as show in the screenshot and for Target Type, select PDF.
    PowerApps Export data to PDF
  • Next Step: Again, add action, Create File and specify three parameters. Here, File Name and File Content are from Convert File (previous action).
    PowerApps Export data to PDF

  • Next Step: add action Create Share Link. File should be Id from previous step. Also specify Link type and Link scope
    PowerApps Export data to PDF
  • Next Step: Add action Respond to a PowerApp or flow. Specify Variable FileLink and value as Web URL (from previous step).
    PowerApps Export data to PDF

Canvas App to trigger file creation

  • Create a Canvas app and add the power automate flow (ExportToPDF) that we just created.
    PowerApps Export data to PDF
  • Put a button on the page. This is to trigger the file creation.
  • Put an HTML textbox that you will supply to the power automate flow.
  • Click on the button and in the OnSelect Property, put this formula. Here, ExportToPDF is the flow name and HtmlText1 is the HTML object of actual data that we want to publish inn PDF file.


Set(PDFLink,

ExportToPDF.Run(HtmlText1.HtmlText).filelink

);

Launch(PDFLink)

· When you run the canvas app and click on the button, the flow will run and you will be able to see the PDF file. Browser may ask you to enable the Pop-up blocker.
PowerApps Export data to PDF


We value your Feedback:

Page URL:

Name:

Email:


Suggestion:

© 2024 Code SharePoint