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 / Apply To Each mechanics
Power Automate
Unanswered

Apply To Each mechanics

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Apply to Each has broken my brain.

I am reading a json array, and processing each record in an Apply to Each. At least that's what I want to do.

 

In the Apply To Each I send and email with the contents of the current record. But now I am getting multiple, duplicate emails.

Posts here say the issue is the email task inside the Apply To Each.

 

I expected Apply to Each to be something not unlike a cursor in SQL, Get a record, do something, get the next record, repeat.

How is Apply to Each different than this?

 

Thx

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    That is the way it works unless you are nesting multiple apply to each loops inside each other.  Can you show a screenshot of your flow?  That may help figure out why its not working.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Only one for each, with the send email in it.

    ForEach.PNG
    Parse.PNG
    Overview.PNG
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The For Each result

    ForEachResult.PNG
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    YOu are looping on something from the query that generates 7 loops.  But your emails are based on something else from the query, not the rows being looped through.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    OOoooookay....I just figured it out and I'm too embarrassed to reveal the reason.

    Just come up with the most insane, ridiculous, idiotic reason you can think of and multiple it by 10 and then you will be in the ballpark of how dumb I was in not figuring this out in the first place.

     

    thanks for your offer of help!

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    While I figured out the duplicate emails, perhaps  you can explain this behavior.

    Every time I edit and save my flow, it adds another For Each. I started with one, and now it has insert two others.

    The Pic should explain it.

     

    Thx

    AddingForEaches.PNG
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Normally that happens because you are inserting a value that its not picking up as being related to the item running the loop.  But I don't' use Power BI enough to know why its happening in your case.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard