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

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

#2
Tomac Profile Picture

Tomac 427 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard