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 / Why is Power Automate ...
Power Automate
Answered

Why is Power Automate adding "For each" Loops to my actions?

(1) ShareShare
ReportReport
Posted on by 17
So essentially, i'm trying to follow this tutorial: Power Automate Send Task Due Reminder Emails
my "AssignedTo" field is a person field so it has the array of person meta data. when i reference the email (because i want to send them an email) it automatically puts it into 2 nesting "For each" loops. this is not what happens in the tutorial. I can drag the actions out of the loops and then delete the loops, but i get the following error when i save: Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: The repetition action(s) 'For_each' referenced by 'inputs' in action 'Select' are not defined in the template.'
Any help on this is extremely appreciated. i have attached images
nesting for each loops.png
taking select action out of loop error on save.png
Categories:
I have the same question (0)
  • Verified answer
    Vejai SH Profile Picture
    560 on at
     
    Do you have multiple values in AssignedTo?
     
    If you don’t need multiple assignees, Go to your SharePoint list → column settings for AssignedTo. set Allow multiple selections = No. Rebuild the flow reference → now AssignedTo.Email is a direct object, not an array → no nested loops.
     
    if you want to take only the first person from the email, then item()?['AssignedTo']?[0]?['Email'] (If you want all emails, you’ll need to use an Apply to each loop to flatten them out.)
     
    Thanks, 
    Vejai SH  
     
    Please mark as answer if my suggestion helps you.
  • Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at
    You're getting the loop because you're trying to process a value that's an array.
    Extract the email addresses from the Persons array (using a Select action) and then join the email array with a comma before/during insertion into the email 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

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard