- 15 Nov 2022
- 1 Minute to read
- Print
- DarkLight
Using formulas in Airtable's primary field
- Updated on 15 Nov 2022
- 1 Minute to read
- Print
- DarkLight
The primary field (the first column in any table) can be configured as a formula, which takes data from other fields in the table to compose a unique name for each record. This can be useful if your table does not lend itself particularly well to a single unique primary field.
Concatenation
You can use a formula with the CONCATENATE()
function or the ampersand sign "&" to link together data from other fields and/or static text. Using the ampersand method, you can build a formula that combines the client name, some static description text, and the order number that looks like this:
{Client & ":order #"}&{Order no.}
Here's the same example, but using the CONCATENATE()
function instead. As you can see, the formula outputs the exact same text string, so the method you use is largely up to personal preference:
CONCATENATE({Client},": order #", {Order no.})
Autonumbering
Formulas for the primary field can also be combined with the autonumber field type to automatically assign each record a unique number.
For example, the formula below concatenates:
the static text "MYPREFIX"
the variable value ({Autonumber}
) which comes from the field named "Autonumber"
the static text "MYSUFFIX" to create unique record names in the primary field.
Here is is all together:
CONCATENATE("MYPREFIX", {Autonumber}, "MYSUFFIX")