Skip to content
Kuovonne's Guide to Scripting in Airtable
  • Pages
    • Kuovonne's Guide to Scripting in Airtable
      • So you want to learn Scripting?
        • Do you just want working code?
        • Can AI write my script?
        • Where do I start?
        • Kuovonne's coding journey (part 1)
      • Free Scripts
        • Formatted Timestamp
        • Interface Sidesheet Url
        • 2nd & 4th Monday of each Month
        • Copy value from one field to another
      • Examples of designing coding solutions
        • Tossed Salad Junction Records
      • Object IDs in Airtable
      • Automation Scripts
        • Converting a script to run as an automation
        • Automation script limits
      • Developing Generic Coding Skills
        • Traits of Quality Code
        • Reading Documentation
        • Using Variables
        • Debugging & Testing
        • Not Time Wastes
        • Comments in Code
      • Possible future topics

Using Variables

Your donations tell Kuovonne that you value her content and want her to continue publishing.

Variable Names

Name functions with a verb and things with a noun
Use variable names that reflect the actual object (e.g. a variable named “records” should be an array of records, not a query result object)
Use singular names for variables that hold a single value, and plural names for variables that can hold multiple values
Limit abbreviations
Be both as specific as possible and generic as possible for the situation.

Variable Name Case

Use the case that is standard for your language.
lowerCamelCase (also known as simply camelCase)
PascalCase (also known as UpperCamelCase)
snake_case
kebab-case
SCREAMING_SNAKE_CASE (often used for constants)

Data Type

Limit each variable to a specific data type. Changing the data type of a variable can lead to confusion and errors. (The main exception is setting a variable to null.)
Some data type choices are clear—a number or a text string. However, some choices are more complex. Should you use an array or an object? If you use an object, what should the keys be?

Variable Scope

The scope of a variable determines which sections of code can use that variable.
Know the scope of your variables and why you chose a particular scope.
Use global variables carefully, mostly for constants.
Know when you are using a local variable versus a similarly named variable inherited from a parent scope.
Define hardcoded values in variables upfront. If the hardcoded value changes, you can change it in one place.
The content in this guide is free, but creating it takes time and money. If you like this content, .

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.