Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

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

(1) ShareShare
ReportReport
Posted on by 12

Hello, all!  Power Automate informs me that this is a "new issue" and I should ask the community for help!  I get the following error when I test a flow I've created:

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

The purpose of the flow is to send the Leave Approval from a Form I created to a pair of other people in my office.  I use "Switch" because different Approval Manager will to do different email approver. Here's what the flow looks like.  Does anyone have any tips on what I'm doing wrong?  Thanks so much!

Condition ; Approve /RejectedCondition ; Approve /RejectedFull FlowFull Flowswitch_.PNG



  • ITDinnadi Profile Picture
    12 on at
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Start_and_wait_for_an_approval_3')?['body/responses']' is of type 'Null'. The result must be a valid array.

    Issue solved. Thanks @v-mengmli-msft for assist me. 👍

  • ITDinnadi Profile Picture
    12 on at
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Start_and_wait_for_an_approval_3')?['body/responses']' is of type 'Null'. The result must be a valid array.

    Hi @v-mengmli-msft ,

    Is there any update ? Appreciate your advise . Thank you

  • ITDinnadi Profile Picture
    12 on at
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Start_and_wait_for_an_approval_3')?['body/responses']' is of type 'Null'. The result must be a valid array.

    Hi @v-mengmli-msft 

    Thank you for your response. I followed your method of placing every condition in each case, and my flow succeeded. However, I'm encountering an issue where I am not receiving the approval email at all. I have tried using Case 2 and Case 3 with different email domains, but still no approval email is coming through.I would appreciate your advice on what I might be doing wrong here.
    approval.PNGsuccededsuccededcondition every case.PNG

    I would appreciate your advice on what I might be doing wrong here.

  • v-mengmli-msft Profile Picture
    on at
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Start_and_wait_for_an_approval_3')?['body/responses']' is of type 'Null'. The result must be a valid array.

    Hi @ITDinnadi ,

     

    The error shows there is no response of Start_and_wait_for_an_approval_3. I think this is because the Switch enters Case2 or other cases instead of Case3, Start_and_wait_for_an_approval_3 didn't run and returns no responses.

     

    Do you want to send email according to outcome of approval in each Case? I think you should put the Condition inside each Case. For example, an email will be sent when Switch enters Case2. All actions in Case3 will not run, and your error will not appear.

     

     

    Best regards,

    Rimmon

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow