Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Power Automate - Apply to each failed

(0) ShareShare
ReportReport
Posted on by 17

Hi,

I am very new to all this and do not know much about building flows. We have build flow for approval for HR, Head of Service and Finance with options Approve, Reject, Reassign and also if incorrect email address is provided the flow will fail and notify the requestor. All is working fine except of "Approval Timed Out". - I am expecting after 28 days the notification to be send to requestor that their submission has not been approved in time because the flow has timed out. Unfortunately this email is not fired up as it deos not pass the "Apply to each"

Petful21_0-1692189692069.png

 

above is showing the error message for  Apply to each for each HR, HOS (also Finance which is missing from the screenshot). 

And the error message is:

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@{outputs('Start_and_wait_for_an_approval_HR')?['body/responses']}@{outputs('Start_and_wait_for_an_approval_HR')?['body/responseSummary']}' is of type 'String'. The result must be a valid array.

Petful21_1-1692189986551.png

 

Not sure if anyone can help me, but I will try.

 

Thanks all

 

 

  • Petful-21 Profile Picture
    17 on at
    Re: Power Automate - Apply to each failed

    Hi @v-jefferni ,

     

    I have tried to delete Apply to each, but it did not work either. There must be something silly set up which I can't work it out and the person who has developed this flow for us has left the company :(.

     

    Thanks anyway

  • v-jefferni Profile Picture
    on at
    Re: Power Automate - Apply to each failed

    Hi @Petful-21 ,

     

    I'm saying that you don't need any Apply to each controls in your flow. You need to move the actions inside those Controls out and delete the Controls, directly use 

    @{outputs('Start_and_wait_for_an_approval_HR')?['body/responseSummary']}

    if you need the response.

     

    Best regards,

  • Petful-21 Profile Picture
    17 on at
    Re: Power Automate - Apply to each failed

    Hi @v-jefferni ,

     

    are you saying I should try to delete Apply to each controls and test it?

     

    Regards,

     

    P.

  • v-jefferni Profile Picture
    on at
    Re: Power Automate - Apply to each failed

    Hi @Petful-21 ,

     

    You are using one response approval type in that action, as the result, the output of that action is of type string. In this case Apply to each Controls are not needed actually.

     

    Best regards,

  • Petful-21 Profile Picture
    17 on at
    Re: Power Automate - Apply to each failed

    Hi @v-jefferni ,

     

    thanks for reply. As I said I am very new to it so not sure what you looking for exactly so I will try share all screenshots for Start and wait and hope you find what you need.

    Petful21_0-1692265256088.png

     

    Approval type: Custom Responses - Wait for one response

     

    Petful21_1-1692265403761.png

     

    Petful21_2-1692265595421.png

     

    Hopefully that is all you need.

     

    Thanks again

     

  • v-jefferni Profile Picture
    on at
    Re: Power Automate - Apply to each failed

    Hi @Petful-21 ,

     

    The values you set in Apply to each control for iterating, which are:

    @{outputs('Start_and_wait_for_an_approval_HR')?['body/responses']}@{outputs('Start_and_wait_for_an_approval_HR')?['body/responseSummary']}

    they are all of type string.

     

    Could you please share the details in Start and wait for an approval action? What's the approval type? What will it be if use @{outputs('Start_and_wait_for_an_approval_HR')?['body/responses']} alone as the input content?

     

    Best regards,

  • Petful-21 Profile Picture
    17 on at
    Re: Power Automate - Apply to each failed

    I should have also said, we have set up a Delay which sends a reminder to HR, HOS and Finance in 20 hrs to approve the request.

    For the testing purposes I have set up the delay for 1 minute and the Flow is also set up to Time out in 10 minutes rather then 28 days, to speed up the process.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow