Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

How to remove expired approval tasks from Power Automate

Posted on May 10, 2023May 14, 2023 by Tom

“Why are the expired tasks still in the approvals list, why doesn’t Power Automate automatically remove them when it times out?”


If you’ve seen some expired approval flows, you’ve probably seen also the related approval tasks. If so, you probably also noticed that the tasks don’t go anywhere. Even though the flow was terminated, the approval tasks still behave like nothing happened. They stay in the list with all the other tasks waiting to be finished. The only difference being that nothing happens – there’s no flow waiting for them, they still exist and can be processed, but not by that flow.

That can be very confusing for users. Why do they still see the tasks that are not “active”? Shouldn’t they be removed from the list? How can you build a restartable flow if the old tasks stay in the system?

Important note: this solution requires Power Automate premium license!

To remove task you’ll need its ID

Since Power Automate doesn’t remove the tasks automatically, it’ll be up to you to remove them. The good news is that the tasks are just rows in the Dataverse table ‘Approval’. All you have to do is remove the corresponding row.

But to remove it you’ll need the approval task ID. Since the expectation is that the approval task will expire before the whole flow expires, you can’t use the ‘Start and wait for an approval’ action. If that action times out it won’t give you any outputs, not even the task ID. To get the task ID you must use the combination of ‘Create and approval’ and ‘Wait for an approval’.

Since the ‘Create an approval’ action will be successful, you can take the ‘Approval ID’ from there. Follow with the ‘Delete a row’ action that’ll run only if the ‘Wait…’ action times out and where you use the Approval ID to delete the task.

Power Automate expired tasks remove

That’s it, now if the task expires the flow will automatically remove it from the task list.

Summary

You can use Power Automate to remove the expired tasks, but it’s more complicated than one might expect. The approach in this article is the simplest one – you completely remove the task, all links will stop working and it won’t appear in any task list. Yet it’s not perfect as it’ll still look as an active task in the email notification, but I didn’t find where that information is located so far…


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

1 thought on “How to remove expired approval tasks from Power Automate”

  1. Pingback: How to handle long term tasks in Power Automate

Leave a Reply Cancel reply

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

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes