Introduction
I often come across where the business wants to have a report in Excel format. But the question is could we save as csv using PowerApps? Then with the help of Power Automate, we can. There are a lot of requirements that could be achieved in PowerApps with the help of Power Automate.
The training department uses the training App. It is for to create a report on all training. They need a provision to download a report on a button click.
Scenario
We have a list of data that needs to be exported as a report and we shall see how to save the report in Csv from PowerApps.
Objective
Power Apps can convert table data from a collection or data source into a CSV file that the user can open in Excel.
In this article, I'll walk you through using Power Apps to export a file to Excel.
Step 1. Creation of SharePoint list
Create a new SharePoint list that will store the details of training.

Step 2. Add A Table To The App To Show Information
Launch Power Apps Studio, then start from scratch to develop a new app. Put a label with the title at the top of the screen.

Step 3. Add Datasource
Add the TrainingList SharePoint list as a datasource.

This list of training can be viewed by inserting a data table and updating the attributes of the items to "TrainingList". We can delete the columns (datacards from PowerApp) that are not required.
Step 4. Setting Up A JSON Sample For The Excel Flow Export

In the above screenshot, We need a means to send data from the table into a flow as Power Automate will be used to build the CSV file. To achieve this, we will transform the data into a JSON format. We must create a sample of the JSON being supplied in order to get ready to create the flow. Make a fresh, empty screen, then add a button on it.
Step 5. Add code on the button onselect attribute
Add this code to the button's OnSelect attribute. Table data from a collection or datasource can be converted into text formatted as JSON using the JSON function.
Set(
varJSONTraining,
JSON(
ShowColumns(
FirstN('TrainingList', 2),
"ParcelNumber",
"Title"
),
JSONFormat.IndentFour
)
)

Step 6. Pass the variable on a label to show the results
After that, add a label on the button's side and enter this code into the Text attribute.
This is the JSON-formatted text that will appear on the label. That's it for now; let's get started building our flow. This JSON sample will be used shortly.













Join the conversation! Your thoughts help the community grow.