Help

Re: How can I auto delete a record after a specific amount of time

3951 0
cancel
Showing results for 
Search instead for 
Did you mean: 
NoCode_Nerd
6 - Interface Innovator
6 - Interface Innovator

Hi,
I am trying to get a record to delete after 24 hours.

I have copied a formula from another thread and changed the time from hours to minutes. I have no idea about scripting so wasn’t able to implement the second part of that thread.

I currently have the “delete” column set to add the word “delete” to the formula cell after 1440 minutes. This then updates another view filtered by “if delete is empty”. In other words, if delete is empty in the new view the record will show on the front-end currently Softr.

This formula seems to work but it’s sluggish and doesn’t update on the 24-hour mark.

IF(DATETIME_DIFF(NOW(), CREATED_TIME(), ‘minutes’) > 1440, “delete”)

My long-winded and probably not well-explained question is: How do I auto delete a record after a 24 hour period?

Thank you.

12 Replies 12

If you need to delete a record at exactly after 1440 minutes, you are not going to be able to use a formula field. As Scott has pointed out NOW() is very limited due to its infrequent updates.

If you are using Integromat to search for records, you will need to have Integromat provide the current time for the search, since you cannot depend on NOW(). You would also need a business account at $99/month to get enough operations to run every minute.

If you are okay with deleting records with more of a delay, you may still be able to use Airtable automations and a script, without relying on NOW(). If you run the script every 10 minutes (versus every minute), you would use under 4,500 runs per month, well under the 50,000 run limit.

If you want to experiment with deleting records in an automation, my “automation helpers” includes scripts for deleting an individual record or deleting records from a “Find Records” automation action. The automation helpers also includes a script for getting the current time that the automation is run. Note that these scripts will not get you all the way to your goal by themselves, but can give you a taste of working with scripts without having to actually touch the code yourself (which I assume you do not want to do, given your “NoCode_Nerd” name).

Sorry for the delay in replying. Thank you for an excellent explanation. There is quite a bit for me to work through there. I’ll come back and let you know how I got on.

Great, thanks Scott.