Feb 05, 2022 08:50 AM
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
Solved! Go to Solution.
Feb 05, 2022 01:27 PM
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!");
Feb 05, 2022 11:27 AM
Welcome to the Airtable community!
Can you link to the script that you are trying to use?
Do you want …
Feb 05, 2022 01:27 PM
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!");
Feb 05, 2022 01:29 PM
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”