web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Problem with adding at...
Power Automate
Answered

Problem with adding attachment to e-mail with an apply to each

(0) ShareShare
ReportReport
Posted on by 32

Hello, hopefully I will be able to explain my problem clearly.

I have a flow that need to send an e-mail at the end containing attachment.
I can add attachment no problem using an append to array variable and it work fine.

The problem:
The flow use an apply to each, so sometime I will need to send 3-4-5 different e-mail and since the append to variable is within the flow, each e-mail get an increment of attachment from the previous item in the apply to each.

So the first e-mail will get is own attachment which is good,
the 2nd email will get the attachment of the first 3 e-mail
3rd e-mail will get attachment from the first 3 and so on...

I need each e-mail to only get their respective attachment..

Here are some screenshot to maybe help understanding a bit

moder4t_0-1682711585525.png

 

moder4t_1-1682711663599.png

the probleme seems to be somewhere in the 2nd e-mail.

How can I used only the attachment from the specific item in the apply to each loop to get attach to the right e-mail, if that make sense?

Thanks in advance!



Categories:
I have the same question (0)
  • Verified answer
    Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @moder4t 

     

    at start of every iteration, you have to cleanup all elements in array so that previous data is not present in the Attachment array variable

     

    inside the apply to each , place the below action first , so that Attachments array will be empty at the beginning of every iteration

     

    Nived_Nambiar_1-1682740234004.png

     

    Hope this helps

    Mark it as solution if it resolves your query !

     

  • moder4t Profile Picture
    32 on at

    I will try this and let you know!! Thank you so so much, this one has been a real head cracker for me

     

  • moder4t Profile Picture
    32 on at

    it was indeed the solution thanks again, it even helped me for another flow I was working on! Much love and have a good day sir!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 785

#2
Valantis Profile Picture

Valantis 669

#3
Haque Profile Picture

Haque 563

Last 30 days Overall leaderboard