Cancel and escalate Power Automate approval request

Power Automate Approvals are well integrated within Microsoft Teams, Outlook and so on. The adaptive cards are great.

Assuming you have one of the use cases below, there is an easy way to solve the use case:

  • If a user didn’t answer in 30 minutes, escalate to the backup person
  • If a user didn’t answer in 1 hour, escalate to the backup person

Below, we will show a solution for these use cases.

On top of that, we will update the adaptive card so that the user sees when no answer is needed anymore because the approval request was cancelled.

In this blogpost, we focus on one approver for every approval action. If you have multiple approvers in one approval action, the situation to escalate is more complex than this.

Defining the time-out time of an approval request

In Power Automate, you can click on the three dots to open extra settings for the approval action:

In that menu, you can define a timeout value.

Some examples:

  • 30 minutes: PT30M
  • 1 day: P1D
  • 6 hours: PT6H

Escalating to another person

The timed-out approval can be escalated by adding a run-after condition. Add a “Scope” with actions in it or a single action after your first approval request. Click on “Configure run after”.

After clicking “Configure run after”, you can select “has timed out”. This means that all the actions within the “Scope” action only run when the first approval action has timed-out.

Don’t forget to click on “Done” to save the changes.

Cancelling the approval request and updating the adaptive card

How it looks like after time-out without additional steps for cancelling

When your just received the approval request, it will look as below in Outlook and in Teams.

This is called an “adaptive card”, because it is not static text in Outlook, but dynamic values and buttons.

How it looks like in Teams:

After the defined amount of time, your approval request will time-out. The adaptive card does not automatically update – cancel (yet) after time-out but you can add an additional action to the “Scope” action to update the adaptive card.

With “automatically update”, I mean that the user can still click “Approve” or “Decline” and does not see that the approval request has timed-out.

How to cancel the original approval request after time-out

Notice below that we replaced the “Start and wait for an approval” by “Create an approval” and “Wait for an approval”. The reason behind this is that Power Automate does not keep the approval ID when you use “Start and wait for an approval”.

In the screenshot below of a flow run this is clarified. You can see in the “Compose” action that only the “Create an approval” action stores the approval ID which we need in the next step to cancel the approval.

The “Update a row” action cancels the approval request by changing the record in Dataverse. All data for the Power Automate Approvals feature is stored in Dataverse.

The result looks like below in Outlook. The adaptive card status has changed and it is clear that the approval request is cancelled. It cannot be answered anymore.

In Teams, it will also get the status “Cancelled”:

To achieve this, you need to fill in the “Update a row” action as below.

Make sure to use the “Approval ID” of the “Create an approval” action, otherwise it will not work!

We achieved to escalate an approval request by using the time-out functionality. After time-out we cancelled the original approval request using the Dataverse connector. We have solved the escalation use case and updated the adaptive card to avoid confusion for cancelled approval requests.

Leave a Reply

Your email address will not be published. Required fields are marked *