Delete Data Daily

874 3
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

Is there a way for tables data to clear at a certain time each day automatically?

3 Replies 3

Sure can, but you'll always need a scripting action to run the deletion.

For a simple table that looks like this;


We can delete an array of records by using;


The code may look something like this;


const {deleteRecordIds} = input.config();
const table = base.getTable("Delete Records");

await table.deleteRecordsAsync(deleteRecordIds);


With the input of records to delete array coming from the no-code action "Find Records";


The Automation can be set to run on a time, find records that meet your deletion criteria, and delete them.


Deleting records in one big batch has the major advantage of being easily recovered from the trash with one click;




The system that @Karlstens wrote will only work if there are less than 50 records to delete. This is due to two issues:

- The "deleteRecordsAsync" function only accepts a maximum of 50 records.

- The "Find Records" action can find a maximum of 100 records.

Instead, if you want a low code solution, I recommend having a filtered view that shows only the records to. be deleted, and then run a script that deletes all the records in the view. A couple of different versions of such a script have been posted on the forums in the past. I am not able to search for them since the change to the new forum platform, but I am on a mobile device. If you are able to search for them, could you please add the link in a reply to this topic? That will help future users who might have the same question.

I can't find the old topic