Mar 04, 2020 03:27 PM
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.
The script asks for confirmation before deleting. Because there is no data in any of the fields, the record ids are shown.
Here is the code:
/*******************************************************************************
Title: Delete Blank Records for Airtable scripting block
Author: Kuovonne Vorderbruggen
Website: kuovonne.com
Date Created: March 4, 2020
Version: 1.0
Copyright (c) 2020 by Kuovonne Vorderbruggen
Usage License: MIT License
## Description
This file has been truncated. show original
Mar 06, 2020 05:13 PM
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.
Mar 18, 2021 11:58 AM
Hello Kuovonne,
I am trying to use your script to alter the following! I would like to combine the first two rows into one by replacing and delteing redundant values, and keeping the valid one under the valid field. How should i do that?
Mar 18, 2021 06:24 PM
@medairtable This script is not designed to combine rows. It is only meant to delete completely empty rows.
If you need to merge multiple records, I recommend looking into the Dedupe app.
Mar 19, 2021 06:19 AM
I did look into it but ended up filtering and reorganzing my data based on filters and groups. It took some time but i was in control hehe.
Mar 19, 2021 06:22 AM
I have another problem and looking for a solution, it would be great if you give me ideas.
I have a team generating leads. Every-time a person fills a form, an incremented leads on his row under {Lead}. It shows the total leads this person got.
Goal: I want to know how many leads are in on a week to week basis. I am not sure how should i do that?
Is it through a last modified field and a formula?
Mar 20, 2021 07:03 AM
In order to calculate statistics for a week, you need a table of weeks, with a row for each week. Then you need to link data records to the proper week. Finally, use rollup (and possibly count) fields to perform the calculations.