Clear (delete records) table every morning

Just getting back into airtable…is it possible to clear (delete all records in a table) every morning? In a perfect world this would be automated at/for a certain time. Seeing scripting and/or automations could be an option, yes?
Full disclosure, an automated scenario from integromat populates the table once a day.
Thank you for your time and effort!

Use Integromat’s “Delete A Record” Airtable module:

Does Integromat delete records one at a time, and does each deleted record count against the quota?

If so, using an Airtable Scripting automation to delete all of the records in the table might help. A single run of an automation script could delete up to 1250 records.

1 Like

Yes and yes.

@Anthony_Rizzi mentioned that he was already using Integromat, but it is a great point to mention that each deletion will count towards the monthly quota.

Can you share this script?

Sorry, I don’t have this script because I haven’t had a reason to write it yet. I’ve written scripts that delete multiple records automatically, and app scripts that can delete all the records in a table at the click of a button. However, so far no-one has hired me to write a script to delete thousands of records at a time in an automation.

I came up with the 1250 number because you can delete up to 50 records per batch, and you can have up to 25 batches in an action. The script would also take a bit of finessing because you can only submit 15 requests per second. To achieve maximum record deletion, the script would need to find a way of dealing with the rate limiting without using setTimeout (which is unavailable in automation scripts). Thus, in practice, it might be difficult to reliably delete the full 1250 records in a single action script. On the other hand, deleting 750 in a single action shouldn’t cause rate limit problem, and with up to 25 actions in a single automation, deleting up to 18,750 records with a single automation run might be possible.

I have a hard time picturing an Airtable base that needs to automatically delete more than 18,000+ records per day.

Eta. I just check the documentation, either they upped the number of mutations per script to 50 instead of 25, or I am remembering incorrectly.

1 Like