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.
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?
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 ...
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?
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:
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..
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.
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) .
Hi @gabibalaban .
Thanks for your help which is getting me ever closer to my solution.
I'm getting a failure on:
I have checked the Date colums in my List which gets its information from a Microsoft Form from the Submission time.
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.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2