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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / For Each vs Apply to Each
Power Automate
Unanswered

For Each vs Apply to Each

(0) ShareShare
ReportReport
Posted on by 8

I'm trying to use a loop in my flow, which will apply multiple actions to each item in an array.  I have read that an "Apply to Each" loop can only apply one action to each item, and indeed if I add multiple actions to the loop it errors out with "The input parameter(s) of operation 'Apply_to_each' contains invalid expression(s). Fix invalid expression(s) for the input parameter(s) of operation 'Apply_to_each'".  This error doesn't appear and the flow runs successfully if I only apply one action.  The second action in the loop does not contain an error, it's a simple compose.

 

So I think I need a "For Each" loop but that doesn't appear anywhere in the list of actions.  My only loop options in Control are "Apply to Each" or "Do Until".  However I know that "For each" still exists, because in one of my other flows it kept appearing automatically in mysterious circumstances.

 

I've searched until I'm blue in the face but can't find a solution, can anyone help?  Thanks.

 

EDIT: It turns out I did have an error in the second action but that reports an error in the loop rather than the action itself, which is why I was confused, so now I can get two actions in the loop.  However, I still don't understand if "For Each" is a valid action - I have checked and I have another flow containing "For Each", which I created yesterday, but I'm not clear on the difference with "Apply to Each" and how to insert "For Each".  Can anyone clarify whether "For Each" is still a supported action, what the difference is with "Apply to Each" and how to insert it?

Categories:
I have the same question (7)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @cambridgepic ,

     

    I'm  afraid there is no such an action named 'For each'. From a functional perspective, I believe you can regard 'Apply to each' as equivalent to 'For each'.

     

    Best Regards,

    Bof

  • cambridgepic Profile Picture
    8 on at

    There is, it's possible it is deprecated but see this screenshot of one of my flows this morning (created two days ago).Screenshot 2024-06-12 094059.png

  • v-bofeng-msft Profile Picture
    on at

    Hi @cambridgepic ,

     

    Once an action is added to the flow, its name can be changed freely. The action in your screenshot is 'Apply to each.' The reason it appears as 'For Each' could be that you used a template, someone renamed it, or there might be another reason that I am unaware of.

     

    Best Regards,

    Bof

  • cambridgepic Profile Picture
    8 on at

    Got it, that makes complete sense.  What doesn't make sense is that I didn't change the name, and nor did I insert it, it somehow appeared automatically.  It could be that there's a template but I didn't create any templates and I'm the only user in our organisation that has used Power Automate.  However, I can survive without knowing the answer to that mystery now I know the answer to my original question.  Thanks.

  • shalem120kjh Profile Picture
    94 on at

    Today I saw the "For Each" action appeared in my flow, and I was also confused since I didn't know it exist. Reading this post and @v-bofeng-msft answer - it became clear. Power Automate added the "Apply to each" action for me (and for you as well), as it always does when you are using an array as an input to another action, without realizing that an "Apply to each" is necessary. The difference is with the new designer it is now added with the name "For each" instead of with "Apply to each". But it is the same action. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard