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 / ERROR Action 'Apply_to...
Power Automate
Answered

ERROR Action 'Apply_to_each' failed

(1) ShareShare
ReportReport
Posted on by 10
I need some assistance figuring out how to find and fix this error. The keeps failing so I ran a test. I attached an image of those error
 
ERROR
Action 'Apply_to_each' failed
 
DETAILS
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body/AssignedTo']' is of type 'Object'. The result must be a valid array.
 
____
The trigger of this flow is When an item is created or modified -->
Get changes for an item or a file (properties only) -->
Condition 2: ColumnHasChanged/AssignedTo  is equal to TRUE -->
 
If yes (Apply to each) <<<ERROR OCCURED HERE>>>
Send an email (V2)
 
Condition 2 Action Failed.png
Apply to Each ERROR.png
I have the same question (0)
  • Verified answer
    Tharusha Jayadeera Profile Picture
    80 on at

    As the exception message says, the issue is with the the variable that you have used for 'Apply to each' action. Apply to each is failing because AssignedTo is being treated as an array, but the trigger returns an object.

    In SharePoint:
    Single person field -> returns object
    Multi-person field -> returns array
     
    Your expression:
    @triggerOutputs()?['body/AssignedTo']
    is resolving to a single object, not a collection -> Apply to each crashes.
     
    My suggestion, since you want to trigger the flow 'When an item is created or modified', you may not use 'Apply to each' action since its a single change. From the other hand if you want to see the status of all the files in SharePoint, you first read the SharePoint directory and use that array using 'Apply to each'.
     
     

    If this helped solve your issue, please mark it as ✅ Accepted Answer.
    If you found it useful, a 🩷 Like is always appreciated.

    Thanks,
    Tharusha

     

  • Verified answer
    Inogic Profile Picture
    1,291 Moderator on at
    Hi,
     
    This error is happening because the Apply to each step is expecting a list of items, but it is actually getting just a single value.
    In your case, the AssignedTo field is a single person field, so Power Automate returns it as one object (one user), not a list. But “Apply to each” only works with lists (arrays), so it fails.
    That’s why the error says the result is of type “Object” and not a valid array.
    How to fix it:
    If your AssignedTo field only has one user:
    You don’t need “Apply to each” at all. Just remove that step and use the AssignedTo value directly in your email action. For example, you can use:
    triggerOutputs()?['body/AssignedTo']?['Email']

    If you still want to keep “Apply to each”:
    You can convert the single object into a list by using:
    createArray(triggerOutputs()?['body/AssignedTo'])

    This will make it work, but it’s not really needed if there is only one user.
    If your intention was to allow multiple users:
    Then check your column settings. If AssignedTo is set to allow multiple selections, it will return a list and “Apply to each” will work without any changes.

    So in short, the issue is just a mismatch: “Apply to each” needs a list, but AssignedTo is giving a single value.
    Hope this helps.
     
    Thanks!
    Inogic
  • NS-16032206-0 Profile Picture
    10 on at
    Thank you! I ended up figuring out what you explained.
    I simply removed the "Apply to Each" action and replaced it with a "Send an email (v2)" action. 
    This is because the column in the list it was firing off of was changed from a multi-select Choice column to remove the multi-select setting. Only one Person in that column can now be selected.
     
    Again, thank you for your quick response!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard