Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
Expand all | Collapse all

Issue when Approval is rejected

  • 1.  Issue when Approval is rejected

    Posted 6 days ago
    Hi, I'm having a issue with a simple approval flow. I have it set so the if the outcome is Approve it sends a email (this works). However if the approval gets rejected the "if no" cause does not work. See below the setup.



    Here is the error: Action 'Apply_to_each' failed

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

    ------------------------------
    Robin Hobbs
    ------------------------------


  • 2.  RE: Issue when Approval is rejected

    Top Contributor
    Posted 3 days ago
    Try putting the response into a compose action just to see it. Alternatively change your approval to be custom response and see if that works.

    Lastly you can try changing your condition to be blank(response) and if it's not equal to TRUE your subsequent actions should work

    ------------------------------
    Sam Duval
    Data Quality Analyst
    Element Financial
    Indianapolis IN
    ------------------------------



  • 3.  RE: Issue when Approval is rejected

    Posted 2 days ago
    The simplest option is to create an array of the foreach expression: createArray(@body('Start_and_wait_for_an_approval')?['responses'])

    ------------------------------
    Toni Malcolm
    GIS Supervisor
    Engineering Department
    City of Mesa
    ------------------------------



  • 4.  RE: Issue when Approval is rejected

    Posted 3 days ago
    Another option is to use a Switch block instead of the Condition block. I've had success using that when the Condition won't cooperate like you're experiencing.

    ------------------------------
    Brian Evans
    ------------------------------