Skip to main content

Notifications

Power Automate - Using Flows
Unanswered

Apply to each error

(0) ShareShare
ReportReport
Posted on by

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

 

  • Jronash Profile Picture
    Jronash 827 on at
    Re: Apply to each error

    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?

  • Re: Apply to each error

    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.

  • Re: Apply to each error

    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

  • Jronash Profile Picture
    Jronash 827 on at
    Re: Apply to each error

    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.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard

Featured topics

Restore a deleted flow