cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Meneghino
Level 10

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

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.

Meneghino
Level 10

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

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

 

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

Thnaks!

 

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

Meneghino
Level 10

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

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.

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

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

flowcalling.png

Meneghino
Level 10

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

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...

View solution in original post

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

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.

Meneghino
Level 10

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

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. ...

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

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

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

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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,138)