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

Sending consolidated emails from excel (TO & CC)

Hi,

 

I am trying to build a flow that selects all rows in an Excel table relating to one To email address, then sends one consolidated  email to the recipient. I also need to include a CC field.

 

I'm very new to flows but have managed to compile the below based on what I've found online - it works perfectly to group the rows and sends only one email, however the CC field is duplicated many times in the output (once per row of data that the CC email is included on).

 

to: email correct

cc: email; email; email; (same email for every row)

 

I have tried using the Union expression to bring only one CC value forward, however as I am already using this for the To email, it throws up an error. 

 

Does anyone know how I can correct my flow?

 

hk4_0-1600316897204.png

hk4_1-1600316923754.png

 

hk4_2-1600316958918.png

hk4_3-1600316982060.png

hk4_4-1600317019232.png

 

 

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Hi!

I would suggest the following:

make CC variable of type array.

Now, inside the true branch condition of 'Apply to each 3' add an 'Append to Array' action block, name 'CC', value CC excel column

Finally, let's focus on 'Send an email' action block, I guess you can assign the following expression as the value for to 'CC' input:

 

join(union(variables('CC'),variables('CC')),';')

 

Just after 'Send an email' remember to reset 'CC' variable value, so it starts as an empty array for the next iteration

 

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

3 REPLIES 3
Super User III
Super User III

Hi!

I would suggest the following:

make CC variable of type array.

Now, inside the true branch condition of 'Apply to each 3' add an 'Append to Array' action block, name 'CC', value CC excel column

Finally, let's focus on 'Send an email' action block, I guess you can assign the following expression as the value for to 'CC' input:

 

join(union(variables('CC'),variables('CC')),';')

 

Just after 'Send an email' remember to reset 'CC' variable value, so it starts as an empty array for the next iteration

 

Hope this helps

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Frequent Visitor

Thank you so much!

Hi @efialttes ,

 

I'm trying to do a very similar workflow, only difference would be that I want to send a single email to each TO group and CC'ing a single time the manager. I used the steps described above and I got the error which can be seen in picture. I don't want to have the "apply to each" row in my excel file, but consolidated per responsible person in the TO field. 

 

I did posted a query as well on community and didn't got a response yet, wondered if you could help would be really much appreciated.

error.JPGUntitled.jpg2.jpg

Can you please advise where to correct?

Many thanks,

Manuela

Helpful resources

Announcements
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!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,992)