Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Cancel approval request

(0) ShareShare
ReportReport
Posted on by 98

Hi!
I have an approval process to send request.
Screenshot_691.png
Screenshot_692.png
Is there an option to cancel a request so that the recipient cannot opportunity to approve or reject.
I have an Approval_ID for this request. Perhaps there is an option using the API?

  • CU28091910-0 Profile Picture
    6 on at
    Cancel approval request
    Although this is kind of an old post, I came accross a use-case, where I would need to cancel both an approval task and the specific flow in which it was initiated.
    The datasource used is a couple of Sharepoint lists, but it should work with any other datasource.
     
    Use-case:
    1. User submits request via PowerApps
    2. Approval flow kicks in
    3. User needs to make a modification to their submitted request via PowerApps (only able to do so if no approval was provided prior to the modification)
    4. New approval flow kicks in, as request needs to be "re-approved"
     
    What I did was building two flows for this:
    1. The actual approval flow
    2. A second flow, which cancels both the approval and the flow as well, then initiates a new approval
     
    Approval flow:
    1. Monitoring for new items in a Sharepoint list.
    2. Compose and Parse JSON steps are saving the flow name and run ID into the Sharepoint list with Update Item.
    3. Using Start an approval and NOT the Start and wait for approval, which makes it hard for you to obtain the approval ID. Start an approval creates the approval and allows you to run further actions within the flow without it being stalled until approval is completed. You can insert a new Update Item step, where you obtain the approval ID and save it into a Sharepoint list, then insert a Wait for an approval step.
    At this point you have all the information to be able to cancel an approval task and/or a flow run.
     
    Second flow:
    1. Trigger can be multiple, but I used a separate Sharepoint list to store modification requests, so using the When a new item is created trigger.
    2. Get Items collects the flow run ID.
    3. Cancel Flow Run (not a premium connector) is added after this, where you define the flow run ID as a dynamic content from the Get Items step, which stops my flow in which the approval runs, so it doesn't get orphaned.
    4. Invoke HTTP request (this is a premium connector though) is being ran after this, with the proper Headers, Request URL and DELETE method (don't worry, it won't actually delete anything), it cancels the actual approval, disallowing approvers to react to 2 approvals for the same item. You will be able to use the saved tenant name and approval ID as dynamic contents within your URL.
    5. After these steps, a new approval is initiated, which will modify the original item's status according to approval outcome.
  • SunnyArk Profile Picture
    2 on at
    Re: Cancel approval request

    You can use action Terminate!

     

    I have a flow that with two branches, each with while loops with delay times. 

    One branch periodically checks if the approval was finished with variable ApprovalDone, which is set to true when a response is received. It is used to send reminder emails to approvals until done. The other also checks variable ApprovalDone, and checks the file property for the selected file. If file property content approval status changed from Pending to any other value, the approval status must be updated to cancel. A second variable, called Approval Cancelled is set to true, and the ApprovalDone variable is also set to true, thus exiting the while loop.

    After the while loop, a condition is used to check if ApprovalCancelled = true. If so, I use a Terminate action from the Control runtime.

    You can also add an update to the item content approval status, to either cancelled (if the column is custom) or draft (if using the default approval flow)

     

    Unfortunately, the dataverse example provided only works if you have premium. 😞

    Note that Terminate cannot be used within a loop.

    Also be sure to include a post-check on approval response to verify if the item content approval status changed, in case it changed during the do while loop delay, before the approval response was received. This way you ensure that the item approval status isn't updated to approved/denied despite the request being cancelled.

  • Jameson Profile Picture
    14 on at
    Re: Cancel approval request

    Were you ever able to come up with a solution to get the wait for approval to cancel?

  • xvzms Profile Picture
    98 on at
    Re: Cancel approval request

    @rzaneti Your test is very good. Thank you!
    I also tried to repeat it and managed to cancel the request. Both in the Dataverse table and in Teams the request was updated to Canceled.
    Screenshot_701.pngScreenshot_700.png
    The only problem is that the flow that run Approval process is still running and has not completed.
    Screenshot_699.png
    I will look for a solution to this problem.

     
     

     

     

  • rzaneti Profile Picture
    4,096 Super User 2025 Season 1 on at
    Re: Cancel approval request

    Hi @xvzms ,

     

    I ran some tests here and finally found a solution. You are in the right path. 

     

    I've just created an approval, which by default will receive the 'Requested' status:

    rzaneti_0-1697669149190.png

     

    By doing this, a new record was generated in 'Approvals' Dataverse table, with no result, Status Reason as pending and Status as Active:

    rzaneti_1-1697669325855.png

     

    Then in Power Automate, I update the following fields with the 'Update row' action:

    rzaneti_2-1697669427764.png

    rzaneti_3-1697669444037.png

     

    After running the flow, the Dataverse record is updated, as expected:

    rzaneti_6-1697669597489.png

     

     

    And the approval receives the 'Canceled' status in Teams:

    rzaneti_4-1697669511425.png

     

    I don't know if this is a problem for you, but the only issue that I got is this weird 'Cancel date':

    rzaneti_5-1697669567826.png

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

  • xvzms Profile Picture
    98 on at
    Re: Cancel approval request

    @rzaneti , Thank you very much!
    I just check it and this work fine.
    But I still want to try not to delete, but to change the status of the item. So that the flow stops working.
    I tried adding the Update a row action, and changing the Result field to Canceled.
    Screenshot_694.png
    Screenshot_696.png
    However this didn't work for me. The request is still in the Requested status.

  • rzaneti Profile Picture
    4,096 Super User 2025 Season 1 on at
    Re: Cancel approval request

    Hi @xvzms ,

     

    You can use the 'Approvals' Dataverse table. By just deleting the record, the approval will disappear. and the recipient won't be able to even see it. 

     

    You just need to be careful to isolate the correct approval to be deleted. In the flow below, for example, I'm filtering the approvals by recipient, title and status, and then deleting all records that match to these filters:

    rzaneti_0-1697639114596.png

     

    For your use case, as you have the approval ID inside your flow, you may be able to directly filter it without complexity. 

     

    The only problem of this approach is that your flow will still be running, even that the approval no longer exists. Apparently, there are some solutions for that here in the community (it wasn't a requirement for my case, so I didn't include it in my flow 🙂 ).

     

    Let me know if it works for you or if you need any additional help!

     

    -------------------------------------------------------------------------
    If this is the answer for your question, please mark the post as Solved.
    If this answer helps you in any way, please give it a like.

    http://digitalmill.net/ 

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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492