cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thejack0fhearts
Frequent Visitor

Create a separate .csv attachment for each row in the original Excel file

Hey, guys - I've got a funky use case here. I'm trying to set up a flow to take the data from each row in a spreadsheet and send an email with that data but also include a .CSV with just the data from that row as an attachment (we're trying to eFax this data, and the eFax solution calls for an attachment).

 

How would you go about filtering down the rows for each record and creating a .CSV attachment?

 

Here's what I've got so far:

flow.png

 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @thejack0fhearts,

 

Do you want to send an email for each row in your spreadsheet?

 

If you want to send an email for each row in your spreadsheet, please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "Get rows" action.
  • Add a "Apply to each", Input parameter set to output of "Get rows" action. Within "Apply to each", add a "Create CSV table" action, From field set to following formula:
array(item())

Add a "Send an email" action, Attachments Name field set to EachRow.csv and Attachments Content field set to output of "Create CSV table" action.

 

Image reference:6.JPG

The flow works successfully as below:7.JPG

 

8.JPG

Best regards,

Kris

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

3 REPLIES 3
v-xida-msft
Community Support
Community Support

Hi @thejack0fhearts,

 

Do you want to send an email for each row in your spreadsheet?

 

If you want to send an email for each row in your spreadsheet, please take a try with the following workaround:

  • Add a proper trigger, here I use Flow Button trigger.
  • Add a "Get rows" action.
  • Add a "Apply to each", Input parameter set to output of "Get rows" action. Within "Apply to each", add a "Create CSV table" action, From field set to following formula:
array(item())

Add a "Send an email" action, Attachments Name field set to EachRow.csv and Attachments Content field set to output of "Create CSV table" action.

 

Image reference:6.JPG

The flow works successfully as below:7.JPG

 

8.JPG

Best regards,

Kris

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

Kris,

Brilliant stuff! It's working great. Thanks!

However, now that I see the output, there are two challenges:

 

First, the eFax picks up the default column widths of the CSV (which don't wrap), so most of the cells are hidden behind longer values. My workaround is to insert "spacer" headers with no value in the "Create CSV Table" step, but I'm curious if there is a more elegant way to format the column widths of the CSV.

 

Second, I'm now realizing how many emails will be generated from each row - is it possible to "group" the rows inserted into each CSV/email by a certain value?

 

Thanks for your help!

 

 

So, I've found a workaround for the formatting issue - I made an HTML table instead and attached it as a .doc, which wraps the text well enough for the faxing application to read it.

 

I'm still stumped about how to group rows with the same ID (name) into one table, so each name only gets one email sent, instead of sending one email per row (which would result in multiple emails to users with multiple rows).

 

Any help would be greatly appreciated, @v-xida-msft.

 

Thanks!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Top Solution Authors
Users online (1,291)