Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
  • 1.  Issue when Approval is rejected

    Posted Apr 30, 2021 11:48 AM
    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 May 03, 2021 07:43 AM
    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 May 04, 2021 01:45 PM
    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 May 03, 2021 02:47 PM
    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