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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow to Delete calenda...
Power Automate
Answered

Flow to Delete calendar events from a specific period

(0) ShareShare
ReportReport
Posted on by 1,154

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???

Categories:
I have the same question (0)
  • Verified answer
    Sundeep_Malik Profile Picture
    6,484 on at

    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. 🙂

  • Chris1968 Profile Picture
    1,154 on at

    Hi @Sundeep_Malik 

    So simple 😀

  • Sundeep_Malik Profile Picture
    6,484 on at

    @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.

  • Chris1968 Profile Picture
    1,154 on at

    Hi @Sundeep_Malik 

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

  • Chris1968 Profile Picture
    1,154 on at

    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 Profile Picture
    6,484 on at

    @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]

     

  • Chris1968 Profile Picture
    1,154 on at

    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 Profile Picture
    6,484 on at

    @ClarkyPA365 

     

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

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    Thank you.  Appreciate your help!!!!

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 173 Super User 2026 Season 1

#3
Kalathiya Profile Picture

Kalathiya 95 Super User 2026 Season 1

Last 30 days Overall leaderboard