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 / Error when applying Fo...
Power Automate
Answered

Error when applying ForEach to Flow.

(0) ShareShare
ReportReport
Posted on by 44

Hi,

 

I'm trying to send an email to a list of 'Approved Users', who are listed in a sharepoint list. For each email, I'd like to address the approved user by their first name. My flow fails with the following error: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each_2')?['ApprovedUser']' is of type 'Object'. The result must be a valid array.

 

Has anybody had this before? Admittedly I'm very, very new to Power Automate, so I've probably overlooked something basic.

 

Kind regards,

 

Stuart.

Categories:
I have the same question (0)
  • Verified answer
    Garethterb1 Profile Picture
    131 on at

    Hi, it looks like there are to many loops in your flow. This happens when the list object is an array like Person or Group. To stop the flow from creating the for each loops automatically you need to type out the object that you are targeting instead of trying to select it from the list.  Eg. I have a list where the column PolicyOwners is a Person or Group so to target the first Display Name I use the following:

    items('Apply_to_each')?['PolicyOwners'][0]['DisplayName']

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 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard