cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ClarkyPA365
Post Prodigy
Post Prodigy

Flow to Delete calendar events from a specific period

Hi,

I would like to delete events, task in a calendar stored on a SharePoint site.

This is to assist in the calendar not exceeding the 5000 item limit.

I would like the flow to go back and delete everything that is 6mths or older and run once a month.

I created this flow, with test Recurrence information

ClarkyPA365_0-1668432578996.png

but getting an error

ClarkyPA365_1-1668432646724.png

 

Any ideas???

1 ACCEPTED SOLUTION

Accepted Solutions
Sundeep_Malik
Community Champion
Community Champion

Hey @ClarkyPA365 

 

Put single quotes around that add days expression:

 

EventDate ge 'Expression'

 

If this helps you, you can mark this answer as the solution. You can give a thumbs up as well. 🙂

View solution in original post

9 REPLIES 9
Sundeep_Malik
Community Champion
Community Champion

Hey @ClarkyPA365 

 

Put single quotes around that add days expression:

 

EventDate ge 'Expression'

 

If this helps you, you can mark this answer as the solution. You can give a thumbs up as well. 🙂

Hi @Sundeep_Malik 

So simple 😀

Sundeep_Malik
Community Champion
Community Champion

@ClarkyPA365 

 

Yea it was 🙂 , just one more thing. Whenever you are using these kind of expressions, also match the format of the column in your database. Though in your case it wont affect much, but just for future cases.

Like: addDays(utcNow(),180, 'MM-dd-yyyy')

Or similar format that is in your database.

Hi @Sundeep_Malik 

Thank you for the advice.  Don't use expression too much currently but will be using them a lot more

ClarkyPA365
Post Prodigy
Post Prodigy

Hi @Sundeep_Malik 

That resolved the error message but I'm finding that it's deleting everything that is in the Event calendar even if it's in the future.  It doesn't for anything over six months old.

In my test I added events for 15/11/2022 onwards and days prior to the 15/11.


Sundeep_Malik
Community Champion
Community Champion

@ClarkyPA365 

 

Try adding le instead of ge there..

 

[I am really bad with ge and le when it comes to date, I get really confused, but try the above, it might help]

 

ClarkyPA365
Post Prodigy
Post Prodigy

Hi @Sundeep_Malik 

'le' deletes records after 180 days.
'ge' deletes records up to 180 days 

All my records I had after May have been deleted.  Those in Dec and up to May are still displaying 🙄

Sundeep_Malik
Community Champion
Community Champion

@ClarkyPA365 

 

I will try it on my end and get back to you in some hours. Working currently.

Hi,

Thank you.  Appreciate your help!!!!

I'll carry on doing testing my end of it resolve it will let you know

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,832)