cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft
Microsoft

How to Export data from DataTable to Excel in PowerApps

Hi,

I have a Data Table in Canvas app. So, I want to export data from Data Table to Excel. Could you please suggest some approaches.

Thanks
Durga

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Durga ,

Do you want to export data from a Data Table control into a Excel file?

 

If you want to export data from a Data Table control into a Excel file, I afraid that there is no way to achieve your needs in PowerApps currently. There is no functionality or functions supported within PowerApps to export data from a Data Table.

 

In addition, within PowerApps, there is no way to select all items/records within a Data Table once time. As an alternative solution, you could consider list your records using a Gallery instead of Data Table. You could configure the Gallery control works as a Data Table.

On your side, you could create a Excel file in your cloud service, e.g. OneDrive. Add columns within this Excel file, and format it as a Excel table. Within your app, create a connection to this Excel table.

After that, you could configure your data in your Data table into a Gallery as below:2.JPG

 

3.JPG

 

4.JPG

Set the OnSelect property fo the "Patch" button to following:

ForAll(
Gallery1.AllItems,
Patch(
OriginalTable,
Defaults(OriginalTable),
{
ProjectName: Label3.Text,
'Due Date': DateValue(Label5.Text),
Executor: Label9.Text
}
)
)

Note: The Label3, Label5 and Label9 represents the Label controls within your Gallery, which used to display corresponding column value.

On your side, you may type:

ForAll(
Gallery1.AllItems,
Patch(
YourExcelTable,
Defaults(YourExcelTable),
{
Column1: Label1.Text,
Column2: Label2.Text,
Column3: Label3.Text,
...
}
)
)

More details about the Patch function, please check the following article:

Patch function

 

Also please check and see if my response within the following thread would also help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Export-data-from-powerapps-to-excel-with-Flow...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Dual Super User II
Dual Super User II

Hi @Durga , 

 

Currently there is no functionality in canvas app to export data directly to excel.
 
But as a workaround, you can create an excel file, somewhere on cloud platform. eg. OneDrive/Dropbox etc. and connect it to your powerapp as a data source. For updating the data, you can use patch command. You could also use Flows that are triggered from Powerapps. 
 
Hope this Helps!
Community Support
Community Support

Hi @Durga ,

Do you want to export data from a Data Table control into a Excel file?

 

If you want to export data from a Data Table control into a Excel file, I afraid that there is no way to achieve your needs in PowerApps currently. There is no functionality or functions supported within PowerApps to export data from a Data Table.

 

In addition, within PowerApps, there is no way to select all items/records within a Data Table once time. As an alternative solution, you could consider list your records using a Gallery instead of Data Table. You could configure the Gallery control works as a Data Table.

On your side, you could create a Excel file in your cloud service, e.g. OneDrive. Add columns within this Excel file, and format it as a Excel table. Within your app, create a connection to this Excel table.

After that, you could configure your data in your Data table into a Gallery as below:2.JPG

 

3.JPG

 

4.JPG

Set the OnSelect property fo the "Patch" button to following:

ForAll(
Gallery1.AllItems,
Patch(
OriginalTable,
Defaults(OriginalTable),
{
ProjectName: Label3.Text,
'Due Date': DateValue(Label5.Text),
Executor: Label9.Text
}
)
)

Note: The Label3, Label5 and Label9 represents the Label controls within your Gallery, which used to display corresponding column value.

On your side, you may type:

ForAll(
Gallery1.AllItems,
Patch(
YourExcelTable,
Defaults(YourExcelTable),
{
Column1: Label1.Text,
Column2: Label2.Text,
Column3: Label3.Text,
...
}
)
)

More details about the Patch function, please check the following article:

Patch function

 

Also please check and see if my response within the following thread would also help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Export-data-from-powerapps-to-excel-with-Flow...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi v-xida-msft,

 

Thanks for your reply.  

 

Our requirement: We pull and show data in apps from Azure SQL Server and our users wanted this data to be exported to excel from DataTable. 

 

Let me try this option and check whether all users can export data or not.

 

Also, we would like to know: is Role based permissions available in PowerApps?

 

Thanks

Durga

 

New Member

To implement this I created a view with required columns in backend SharePoint list to match data from DataTable.
Then created below url for downloading view data to excel:

{Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={LIST ID}&View={View ID}

Then in PowerApps added one button. Set "OnSelect" property to launch above url.
Launch("URL",{},LaunchTarget.New)

This way we can download the data to excel. We can add filters to the view to match the data from DataTable.

Sharing this idea as it might help someone with similar need.
Let me know if there is any other way of implementing this.

Works perfectly 😀

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,295)