Skip to main content

Delete Data Daily

  • December 15, 2022
  • 4 replies
  • 20 views

Forum|alt.badge.img+2

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

4 replies

Karlstens
Forum|alt.badge.img+20
  • Inspiring
  • 601 replies
  • December 15, 2022

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;

deleteRecordsAsync()

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;

 

 


kuovonne
Forum|alt.badge.img+27
  • Brainy
  • 6002 replies
  • December 16, 2022

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.


Forum|alt.badge.img+2
  • Author
  • New Participant
  • 2 replies
  • December 16, 2022
kuovonne wrote:

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


ScottWorld
Forum|alt.badge.img+33
  • Brainy
  • 8794 replies
  • April 2, 2025

If you’d like a no-code way to delete your Airtable records on a schedule that doesn’t require any scripting at all, I would recommend using Make’s advanced automations for Airtable to do that.

Check out the screenshot below for an example of how this automation could be setup in Make.

If you’ve never used Make before, I’ve assembled a bunch of Make training resources in this thread. For example, here is one of the ways that you could instantly trigger a Make automation from Airtable.

Hope this helps! If you’d like to hire the best Airtable consultant to help you with anything Airtable-related, please feel free to contact me through my website: Airtable consultant — ScottWorld

 


Reply