Latest Posts

PowerApps Export data to CSV - Excel


In this article, we will see how we can export collection object data to CSV format from Canvas app using Power Automate.

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

Power Automate Flow to Create CSV file

  • First, we’ll create a Power Automate Instant flow.
    PowerApps Export data to CSV - Excel
  • Give proper name to the flow. The trigger type will be PowerApps.
    PowerApps Export data to CSV - Excel
  • We are going to take the input from PowerApps (Canvas App), Select an input type (String/Text).
    PowerApps Export data to CSV - Excel
  • Next Step: Add Compose (This will create an object from the above data) and as an input, take data from previous step(trigger).
    PowerApps Export data to CSV - Excel
  • Next Step: Add Create CSV Table action.
    PowerApps Export data to CSV - Excel
  • In the From textbox, take this Expression: json(outputs('Compose'))
  • PowerApps Export data to CSV - Excel
  • Next Step: Add Create file action. As you can see, we are creating file in SharePoint site. You need to specify Site URL and specify Document library.
    PowerApps Export data to CSV - Excel
  • Here, File Content is the output of the previous action (Create CSV Table).

Canvas App to trigger file creation

  • Create a Canvas app and add the power automate flow (ExportToExcel) that we just created.
    PowerApps Export data to CSV - Excel
  • Put a button on the page. This is to trigger the file creation.
  • Click on the button and in the OnSelect Property, put this formula. Here, ExportToExcel is the flow name and SampleColl is the collection object of actual data that we want to publish as CSV file.


ExportToExcel.Run(

JSON(

SampleColl,

JSONFormat.IncludeBinaryData & JSONFormat.IgnoreUnsupportedTypes

)

);


· When you run the canvas app and click on the button, the flow will run and you will be able to see the CSV file created in the specified SharePoint library.


We value your Feedback:

Page URL:

Name:

Email:


Suggestion:

© 2024 Code SharePoint