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

Send email with multiple attachments

Hi,

 

I have a sharepoint folder that will receive two files.  Each file I would like to send in an email.  Screenshots are below, I am getting the error:


"The execution of template action 'Apply_to_each" failed: the result of the evaluation of "foreach" expression '@triggerOutputs()?['body'] is of type 'Object'. The result must be a valid array."

 

The outcome that I require is one run of the flow for both attachments and then added as an attachment to an email.

 

Screenshots below, thanks for your time in advance.

 

screen 1.pngscreen 2.pngscreen 3.png

1 ACCEPTED SOLUTION

Accepted Solutions
manuelstgomes
Community Champion
Community Champion

Hi @Jonnyphoto 

 

The error is indicating that you don't have an "Array" in the "Apply to each," and it's true because you're passing the "File Content" that is not an array. 

 

I found a tutorial on how you can add multiple attachments to an email. There are some steps for me to describe here.

https://www.tachytelic.net/2020/09/power-automate-add-multiple-attachments-approval-email/

 

The tutorial describes an approval Flow, but the concert is the same.

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

View solution in original post

1 REPLY 1
manuelstgomes
Community Champion
Community Champion

Hi @Jonnyphoto 

 

The error is indicating that you don't have an "Array" in the "Apply to each," and it's true because you're passing the "File Content" that is not an array. 

 

I found a tutorial on how you can add multiple attachments to an email. There are some steps for me to describe here.

https://www.tachytelic.net/2020/09/power-automate-add-multiple-attachments-approval-email/

 

The tutorial describes an approval Flow, but the concert is the same.

 

Can you please check if and let me know if you have any questions?

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (3,806)