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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 330

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 123

Last 30 days Overall leaderboard