web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Deleting Completed Tasks

(0) ShareShare
ReportReport
Posted on by 80

Hello,

 

Is it possible to have a recurring flow delete all completed tasks that are older than 2 months?

 

I am not sure if I am going in the right direction with this:

 

frankc9_1-1645045498331.png

 

I have the same question (0)
  • Verified answer
    MarvinBangert Profile Picture
    1,922 Most Valuable Professional on at
    Re: Deleting Completed Tasks

    Hi @frankc9 

    Yes, this is correct as far as I can see it. If you want to test this before deleting anything, you can also remove the "delete a task" action and put in a "compose" action. I would recommend using a "filter array" after the "list tasks", because you will receive all tasks from this planner, also these that are not completed now. Within your condition, this will occurs an error for this elements, because the "completedDateTime" field is NULL. If you first filter out only the items where the percent completed is equal to 100, you are good to go.

    Also if you want to get rid of the condition, you can write a more advanced query within your "filter array" that checks if the percentage completed is 100 and the completed Date Time is bigger than the current time - 2 Month (2/16/2022 - 2 Month = 12/16/2022).

     

    Does this help you? Otherwise please give me some more information.

    Best regards
    Marvin

    If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

    Blog: Cloudkumpel

  • frankc9 Profile Picture
    80 on at
    Re: Deleting Completed Tasks

    Hello @MarvinBangert ,

     

    Thank you very much for your assistance!  Filtering out the completed tasks was the issue I was having with the NULL error as it is working properly now!  Would it make any kind of difference to do an advanced query instead of a condition?  Also, do you know if it's possible to filter all tasks completed instead of just the first 389 most recent completed tasks?  Possibly start with the oldest completed first?

     

    frankc9_0-1645115485481.png

     

  • Remijn Profile Picture
    2 on at
    Re: Deleting Completed Tasks

    Hi Marvin,

     

    Could you elaborate on the requiered filter array? I've been struggling to get the flow to work. After adding the filter array selecting only the tasks with a 100% completion the flow seems to find no tasks that are completed and thus doesn't delete anything. 

  • pbrody Profile Picture
    6 on at
    Re: Deleting Completed Tasks

    Is there a way to just share your solution rather than me trying to copy it and recreate it?

  • esurratt Profile Picture
    5 on at
    Re: Deleting Completed Tasks

    Would you be able to post the finished flow screenshots? I am attempting to copy this, but keep having issues. 

     

  • VGSilva Profile Picture
    2 on at
    Re: Deleting Completed Tasks

    I also managed to find another solution. Using Teams, with the Planner 'app', list the completed tasks you want to delete (use filters). I'll be able to select various (or all of them) in the list at the same time, then right click and press delete. 

  • RobP0101 Profile Picture
    9 on at
    Re: Deleting Completed Tasks

    That defeats the point of automating the task.

     

  • RobP0101 Profile Picture
    9 on at
    Re: Deleting Completed Tasks

    I have followed this flow including the filter array but despite deleting the completed task I am still having the flow fail because it identifies non completed tasks. Any idea on setting the filter correctly so I don't get the fail message?

     

  • Phill_S Profile Picture
    5 on at
    Re: Deleting Completed Tasks

    Hi Rob, 
    I have managed to get this working, you need to pass the values from the filter array to your final condition, (I suspect some will have a better way but this is how I managed to get it to work - planner delete ss.JPG


  • RobP0101 Profile Picture
    9 on at
    Re: Deleting Completed Tasks

    Many Thanks. I thought I had tried this already but must have had one thing set incorrectly. This now works 😁

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 647 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 350 Moderator

#3
developerAJ Profile Picture

developerAJ 256

Last 30 days Overall leaderboard