Scripting block: delete empty records

Deleting empty records

Sometimes a base ends up with empty records - records with no values in any fields. Here is a utility to delete them from a table.

A table with several empty records

Using the script

deleteBlankRecords2

The script asks for confirmation before deleting. Because there is no data in any of the fields, the record ids are shown.

deleteBlankRecords3

The table with no empty records:

Here is the code:

1 Like

I updated the gist with some enhancements:

  • Sort records by the primary field. Empty records should be at the top of the sort.

  • Retrieve and check only non-computed fields. Should improve performance for tables with lots of computed fields.

  • Stop looking for empty records after reaching batch limit of 50.

  • Improved comments and variable names.