cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AmitLoh-Powerap
Kudo Kingpin
Kudo Kingpin

how to export data from powerapps to excel(by user)

how to export data from powerapps to excel(by user), I know there is CDM table export but I do not want user to see entire CDM table.

I need a functionality in powerapps that exports current screen set data to excel, pdf, word etc.

46 REPLIES 46

Actually there may be an easier way of sending the data as a csv attachment if you have Office 365 Outlook.

 

The answer is buried here:

https://powerapps.microsoft.com/en-us/tutorials/connection-office365-outlook/#sendemail

 

You will see that you need to supply the attachments as a table, namely:

  • Attachment (optional): Send an attachment. Attachment properties include Name (required), and ContentBytes (required).

I think this means that you create your CSV data with the Concat function as the content bytes.  This needs some experimentation, but you could create a collection with the filename and the content bytes (your csv data) then try to use the collection as the parameter of the send email function.

 

Please let me know how you get on.  I would try this myself but have no time today.

I have now had time to experiment and I got the CSV file creation to work.

 

This is how I did it:

  1. Create a flow to do the following sequence:
    a) create a file in SharePoint library (files with the same name will be overwritten)
    b) fetch the content of the file
    c) send the content of the file by email as an attachment
  2. In the app, create a button to call the flow, where the file content is the csv text created by the Concat function

There might be a better way to do it but it works.  Screenshots follow. Please note that the filename parameter in the last screenshot was left over from a previous version of the flow.

 

 001.JPG002.JPG003.JPG004.JPG

 

Thnaks!

 

Are you pulling data from powerapps screen into csv via flow? Please let me know.

No, the csv file content can be created by a Concat function in PowerApps with your data.

Say your data is source is MyDataSource and you filter it, then you can do this to create a csv file for example:

Concat( Filter( MyDataSource, MyColumnA = "MyFilterValue"), MyColumnB & ", " & MyColumnC & Char(10))

Please let me know if this is not clear.

You can add column titles at the start etc. once you understand how it works.

I do not see an option to call flow in powerapps button-

flowcalling.png

You can only add flows when you edit apps in PowerApps studio, it is the main difference between the web editor and the studio.

Please see point 6 of the following...

https://powerapps.microsoft.com/en-us/tutorials/create-app-browser/#known-limitations-of-the-preview...

I was able to make it work!!! thanks!

 

Now I also need to send first row as all columns( how to do this?)

I was able to get filtered search result in csv to ondrive but I need to add first row as columns.

Well done!

I think the easiest approach is just to add a piece of text at the beginning, before the concat function, with the column names, something like this:

"Column A, Column B, Column C, Column D"&Char(10)&Concat(etc. etc. ...

thanks that worked!

Now I also want to send this file as attachment to a user. File is getting created on one drive for business.

I am getting below error-

 

Unable to process template language expressions in action 'Send_an_email' inputs at line '1' and column '1509': 'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_office365']['connectionId']' cannot be evaluated because property 'shared_office365' doesn't exist, available properties are 'shared_onedriveforbusiness'. Please see https://aka.ms/logicexpressions for usage details.'.

 

flowcalling1.png

another query- 

 

I want contains filter instead of 

MyColumnA = "MyFilterValue"

How do I do that. I may also need multiple and or afterwards. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (3,408)