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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Delete Items Older tha...
Power Automate
Answered

Delete Items Older than X Days from Sharepoint List Created From Microsoft Forms?

(0) ShareShare
ReportReport
Posted on by 13

I am trying to create a Power Automate flow to remove data older than 21 days from a Sharepoint List created from Microsoft Forms.

 

I have created a COVID-19 contact tracing List using Power Automate and to comply with  Data Protection I would like to delete data over 21 days.

 

I have a column named Date but don't know how to creat a simple work flow.

 

Can anyone help as this solution would help many users who have to collect details of visitors?

 

Many thanks.

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,272 Moderator on at

    Hi @Whisky1 ,

    Here is my proosal ...

    Capture.PNG

    Hope it helps !

  • Whisky1 Profile Picture
    13 on at

    Hi @gabibalaban .

     

    Thanks for your help which is getting me ever closer to my solution.

     

    I'm getting a failure on:

    Whisky1_0-1605098435146.png

    Whisky1_1-1605098672462.png

    I have checked the Date colums in my List which gets its information from a Microsoft Form from the Submission time.

     

    Whisky1_3-1605099146692.png

     

    Whisky1_2-1605098988752.png

     

    Can you or anyone else see what the issue is?  I read somewhere that dates and times should be converted to UTC which might be the issue.

     

    Once again @gabibalaban  many thanks.

     

     

     

  • Verified answer
    CU-18081211-6 Profile Picture
    9,272 Moderator on at

    @Whisky1 

    You missed lt (lowerThen) in the GetItems formula ... some please try: Date lt ...rest of formula.

    Also, please take in consideration to use Created column (rather then Date column) of your sharepoint list (it's a Default column that store the datetime value when the item was created)  .

  • Verified answer
    Whisky1 Profile Picture
    13 on at

    Hi @gabibalaban ,

     

    Brilliant thanks.  You sorted it no problem.

     

    I now have it running daily to delete the information older than 21 days to comply with our GDPR.

     

    Thanks a million.

  • Chris989 Profile Picture
    2 on at

    Hey.

     

    Hoping someone here may be able to help. I've got exactly this scenario and I've set up the flow as above - except I'm using delete file instead of delete item as it's not a SharePoint list but a document site. 

     

    If I trigger the flow as a test, it works as long as nothing is older than the date specified. The minute it actually has something to delete I get this error: 

     

    Chris989_1-1643115827369.png

     

    It's right, there isn't a file called 8, but this the ID of one of the files when you look at the output of get items. 

     

    I'm at a bit of a loss.. 

     

     

  • ncotela23 Profile Picture
    101 on at

    Hi there - When I try this it keeps failing. Please see how I have it set up in image 1 below and the error in image 2 below. Any ideas?

     

    ncotela23_0-1665700370134.png

     

    ncotela23_1-1665700397142.png

     

     

  • renatopc84 Profile Picture
    44 on at

    Hi ncotela23

     

    I assume the problem has been already solved, but for documentation, in your "Filter Query" is missing an operator like lt, ge, gt, le. Example Created lt ...

  • Jste84 Profile Picture
    4 on at

    Hi all, im looking to do something very similar but rather than delete a whole record from sharepoint. I only need to delete one field, does anyone know if this is possible?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 476

#2
Haque Profile Picture

Haque 424

#3
David_MA Profile Picture

David_MA 350 Super User 2026 Season 1

Last 30 days Overall leaderboard