Help

Re: Delete Empty Records on automation

Solved
Jump to Solution
3095 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Pascal_Pomaska
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey Guys,
I’m looking for a (simple) automation that automatically deletes all empty records.
My Airtable is being feeded with empty records due to a dirty API.
So I need to run a script automation on schedule to clean up these blank records…
I have zero experience writing scripts. I tried to use some older script from the airtable community but it does not have the most up to date syntax i guess – because it’s full of errors.

Greets from Germany
Pascal

1 Solution

Accepted Solutions
Pascal_Pomaska
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey Kuovonne,
I found something that works.
For code-dyslexics like me – here is something that works using a View and deleting anything in that view based on a trigger,

let table = base.getTable("User Register");
let view = table.getView("Empty Records");
let query = await view.selectRecordsAsync();
let recordId = query.records[0].id;
await table.deleteRecordAsync(recordId);
console.log("Deleted a record!");

See Solution in Thread

3 Replies 3

Welcome to the Airtable community!

Can you link to the script that you are trying to use?

Do you want …

  • a link to a free script (if one exists)
  • someone to write the script for free (if someone is willing)
  • help learning to write the script yourself
  • to pay for someone to write a script
Pascal_Pomaska
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey Kuovonne,
I found something that works.
For code-dyslexics like me – here is something that works using a View and deleting anything in that view based on a trigger,

let table = base.getTable("User Register");
let view = table.getView("Empty Records");
let query = await view.selectRecordsAsync();
let recordId = query.records[0].id;
await table.deleteRecordAsync(recordId);
console.log("Deleted a record!");

All you need to do is setting up a filter in a separate view that is like: Show all records that are Empty in “field X” or do “not contain” @ in “Email-Field”