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 Automate
Unanswered

Apply to each error

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I've got a flow that pulls content from a form and puts into the body of a VSO work item.  I get this error and not sure how to interpret it:

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@{triggerOutputs()?['body/resourceData/responseId']}@{triggerBody()?['body']}@{triggerOutputs()?['body/resourceData']}' is of type 'String'. The result must be a valid array.  Thanks for any help

 

Categories:
I have the same question (0)
  • Jronash Profile Picture
    827 on at

    Sounds like there's a problem with the "Select an output from previous steps" field in your "Apply to each" block.  I think if you look at your Flow, you'll see that you have two references to dynamic content there.  You can only have one.  Delete the one you don't need, and it should run.

  • LH-22072131-0 Profile Picture
    Microsoft Employee on at

    Thanks Jronash.  I've tried using a single reference (Rosponse Id, resourceData & body) separately but they all come back with an error as they don't appear to be in the array format.  I'm wondering if there is an expectation to store the record in a file to then reference?  Thanks for any other suggestions

  • LH-22072131-0 Profile Picture
    Microsoft Employee on at

    Here is the error when I select "body":

    The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']' is of type 'Object'. The result must be a valid array.

  • Jronash Profile Picture
    827 on at

    What type of data are you trying to loop through here?  SharePoint, Excel, OneDrive, something else?  Without knowing that or seeing how your data is organized, I can only guess what you would need to select for your loop.  But for many of the connectors, the array of values is accessible in dynamic content as "value" or "values".  Is there something like that that you could try?

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard