“The users complain about having too many tasks from expired Power Automate flows, can I somehow remove these old task(s)?”
As you probably know, a single instance of a Power Automate flow can run only for 29 and half days. Once it reaches this deadline, the flow will stop. Nothing else will happen. Which can be a problem if it uses any approvals.
Since the Approvals are a separate application, they don’t really care whether a flow is running. There’s a task that’ll stay open until it’s completed, no matter that there’s no flow to continue, no matter that nothing will happen upon completion. How do you deal with such tasks? How do you make sure that users won’t spend time reviewing expired tasks?
Just delete the tasks
The reliable option I found to remove the tasks from the list is to delete the task completely. What users see in their list of approval tasks is the combination of information from the Approval and Approval Request tables. If the entry doesn’t exist, users won’t see it.
With the assumption that all tasks older than 30 days that are still active (statecode = 0) are expired, start by filtering all such tasks in the Approval table.
IMPORTANT: make sure that you don’t have any custom solution that’s still processing those tasks! If you do don’t just delete them! Also, be sure to delete only the Active tasks, not those that were already completed!
createdon lt '@{addDays(utcNow(),-30)}' and statecode eq 0
Once you filter the approvals, delete them.
No entry in the Approvals table, no entry in the user’s Approvals app.
Summary
The only reliable solution I found to remove old Power Automate task(s) is to just delete them. Find the expired task using filters and delete the rows. Once it’s gone from the Approval table it’ll be gone also from the Approvals applications of the users. Just be very careful to not delete any of the completed tasks.