Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Apply to Each - Condition

(0) ShareShare
ReportReport
Posted on by 41

Hello,

 

I am VERY new to Power Automate. 

I'm trying to create a flow that triggers an email be sent if the response to one question on a from is YES and does nothing if the response is NO. Here is what I have so far and the error message I'm getting.

 

ERROR:

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.

 

 

storere_0-1698234236970.png

 

  • Expiscornovus Profile Picture
    31,732 Most Valuable Professional on at
    Re: Apply to Each - Condition

    Hi @storere,

     

    There should be an Accept as Solution button on each reply (next to the thumbs up and reply buttons). Just pick one which solved your issue 😁

  • storere Profile Picture
    41 on at
    Re: Apply to Each - Condition

    Seems I overcomplicated it! you are right!

    How can I mark this as solved for you?

  • Verified answer
    grantjenkins Profile Picture
    11,059 Super User 2025 Season 1 on at
    Re: Apply to Each - Condition

    You need to move everything outside the Apply to each as you will only get a single form submission from the trigger. The structure should look something like that below.

     

    grantjenkins_0-1698235896153.png

  • Expiscornovus Profile Picture
    31,732 Most Valuable Professional on at
    Re: Apply to Each - Condition

    Hi @storere,

     

    The error is caused because your are trying to loop through a single object. The apply to each would expect a list of items/array instead for the looping.

     

    In this setup an apply to each would not be needed. Normally a Get response details can directly be placed after the first trigger action and use the response id. See for an example below.

     

    getresponsedetails.png

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >