cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
frankc9
Advocate I
Advocate I

Deleting Completed Tasks

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
MarvinBangert
Super User
Super User

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

View solution in original post

2 REPLIES 2
MarvinBangert
Super User
Super User

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
Advocate I
Advocate I

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

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,370)