Here’s a quick guide on how to create an automation that deletes records automatically! (Needs a paid plan for access to the Run a Script automation action)
Possible use cases include:
- Records over a year old to be cleared out automatically
- Deleting flagged duplicates
- Resetting daily / weekly logs for reporting, etc
I’ve put together an example base where everything’s set up for reference, and here’s a gif of the automation running.

First, we’ll create an automation that triggers when the ‘Delete’ checkbox is ticked, and add a Run a Script action to it:

We’ll then paste in the following code:
let {recordId, tableId} = input.config()
await base.getTable(tableId).deleteRecordAsync(recordId)The code uses `recordId` and `tableId`, so we’ll define those as input variables by clicking ‘Add input variable’ on the left:

You can see how we typed in ‘recordId’ and ‘tableId’ manually, then selected the appropriate option via the dropdown menu
For ‘recordId’, we select the record ID of the triggering record like so:

And for the tableId, we select the table that we want to delete records from, in this case, the ‘Projects’ table:


And that's pretty much it! Your Run a Script action should look like this now and you can turn on the automation to test it!

Optional but useful: The example base also includes an automation that deletes linked records automatically!



