cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jgutierrez
Level: Powered On

Flow creating one extra email attachment

Hi,

 

I am trying to create a simple flow that, when I receive a specific automatic email, it will grab the attached image form this automatic email. Then, a new email is sent, and the email includes the attachment I mentioned.

 

However, the problem I have is that even though the automatic email only has one attachment, flow is creating another one called 'screenshotpng'. Due to the 'apply for each attachment' logic, it is then sending two emails instead of one: one email with the original attachment, and another with the 'screenshotpng' attachment. Does anyone know why this might be the case? Can I prevent this 'duplicate' or at least filter it out?

 

atch.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow creating one extra email attachment

Hi @jgutierrez,

 

That is because Attachments within Email is an Array.

Microsoft Flow would take action with each of the elements within the Attachment.

 

To workaround this, we could add a condition within the Apply to each, to filter the needed image out and then send it with another Email.

18.PNG

 

Further, if the attachments only contains those two image, and the position is never change, then we could take use of expression to get the proper attachment:

For example, if the image you wanted is always the first element, then we could take use of the expression below:

 

first(triggerBody()?['Attachments'])

 

For more function reference, please check:

WorkFlow Definition Language schema for Azure Logic Apps

 

Regards,

Michael

 

Community Support Team _ Michael Shao
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

2 REPLIES 2
Community Support Team
Community Support Team

Re: Flow creating one extra email attachment

Hi @jgutierrez,

 

That is because Attachments within Email is an Array.

Microsoft Flow would take action with each of the elements within the Attachment.

 

To workaround this, we could add a condition within the Apply to each, to filter the needed image out and then send it with another Email.

18.PNG

 

Further, if the attachments only contains those two image, and the position is never change, then we could take use of expression to get the proper attachment:

For example, if the image you wanted is always the first element, then we could take use of the expression below:

 

first(triggerBody()?['Attachments'])

 

For more function reference, please check:

WorkFlow Definition Language schema for Azure Logic Apps

 

Regards,

Michael

 

Community Support Team _ Michael Shao
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

jgutierrez
Level: Powered On

Re: Flow creating one extra email attachment

Hi @v-micsh-msft,

 

Thanks for your help, I solved it something similar: array(last(triggerBody()?['Attachments'])) 

Strange that even though there is only one attachment, somehow an empty one is created resulting in teh array. Is this on purpose or a bug?

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (6,066)