cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Send an email v2 with attachments

Hello,

 

Recently I have created a flow that consists of many approvals, for each approval form I have attached the file that was uploaded to the SharePoint Item.

 

What I want to achieve is the following:
If any of these approvals response is equals to rejected, I want to stop the flow and send an email to the user with the attached file that was uploaded in the SharePoint item. Besides, if they all approved the flow should not terminate.

 

The problem is when I use the same array variable of the attachments in the "Send an email (V2)", the flow fails with the following error message below:

error.PNG

Knowing that in the approval form action the attachments work perfectly and contain data either display it in the approval form.

Please have a look at the screenshots below about the attachments actions:

Capture.PNGCapture3.PNG

What I should use actions to solve this issue, can please someone explains in detail and provides an example?

Any help will be greatly appreciated.
Thank you!

8 REPLIES 8
Highlighted
Super User
Super User

Re: Send an email v2 with attachments

Hello @Julien2 

 

I believe the error is within the "Append to array variable" as the second line should be "ContentBytes" rather than "Content" - see below one I built yesterday.

 

Annotation 2020-02-25 162814.png

 

I presume you already have read this article as you have put all the correct steps in, but the below is a very helpful article on this topic - especially Vytenis Jazbutis' comments at the bottom.

 

https://preview.flow.microsoft.com/en-us/blog/multiple-attachments-single-email/

 

Thanks

 

Bradley

Best regards,

Bradley
If this post helps, then please consider Accept it as the solution to help the other members find it more
Highlighted
Super User III
Super User III

Re: Send an email v2 with attachments

Hi @Julien2 

 

@burgett94  mentioned your content mapping is wrong here. 

 

In your Append to array variable action step you have mapped the content as follows:

body('Get_file_content_using_path')['$content']

 

Change the above to this expression.

body('Get_file_content_using_path').$content

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Post Prodigy
Post Prodigy

Re: Send an email v2 with attachments

Hello @burgett94 ,

 

I have tried to use "ContentBytes" instead of "content", unfortunately, the array variable that exists in the approval action failing the flow because of the "ContentBytes".
Please have a look at the error message when I have used "ContentBytes":

Capture2.PNG

The "content" was working as expected for the approval actions but not for the send email (v2) action.

 

Thank you.

Highlighted
Post Prodigy
Post Prodigy

Re: Send an email v2 with attachments

Hello @abm ,

 

I am already using the same expression you mentioned but when I saved the flow, the editor automatically converted it from expression into a format and the expression change back again to:

body('Get_file_content_using_path')['$content']

 

Please take a look at the screenshots below:

Before Saving

Capture.PNG

After saving:

Capture.PNG

 

Looking forward to your response.

Thank you!

Highlighted
Super User III
Super User III

Re: Send an email v2 with attachments

Hi @Julien2 

 

Thanks for the update. 

 

Are you sure your list has attachment?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Post Prodigy
Post Prodigy

Re: Send an email v2 with attachments

Hi @abm ,

 

Sure, the "Get attachment" action returns the attached item either in the approval form action it works as expected.

Please have a look at the screenshots below:

Capture.PNGCapture1.PNG

 

Looking forward to your response.

Thank you!

Highlighted
Super User III
Super User III

Re: Send an email v2 with attachments

Hi @Julien2 

 

I can see an Apply each loop before the terminate. What does this loop do?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials
Highlighted
Post Prodigy
Post Prodigy

Re: Send an email v2 with attachments

Hi @abm ,

 

As a result, this apply to each action will only display the outcome and the approver name after his response. So it's not related to the attachments. I am using the Outlet array at the end of my flow in an HTML table.

You can take a look at this screenshot:

Capture.PNG

Thanks

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (5,797)