Gallery
Kuovonne's Guide to Airtable
Share
Explore
Kuovonne's Guide to Airtable
Specific Solutions

Table ID in a formula

Thank Kuovonne for creating this content!

Inspiration

When building a URL for a record in a formula field, you need to know the base ID and the table ID. However, when you duplicate the base, the base ID and table ID change, which can break your formula.
While there is no way to get a base ID in a formula, there actually is a roundabout way to get a table ID in a formula.

Overview

When you create a button field that opens an extension, the value for the extension is a URL that contains the URL of the record, which includes the table ID. You can then use a formula field to extract the table ID from the value of the button field.

Add an extension

Add an extension to a dashboard. The most convenient extension is Page Designer. You can configure the Page Designer extension to use the table in question, but the actual table does not really matter. I like to add static text that explains that the extension is being used to extract the table ID.
image.png

Create a button field

Create a button field that opens the extension.
image.png

Extract the table ID using a formula field

Create a formula field that references the button you just created. You can see in the preview that the formula value includes the table ID.
image.png
Build out the formula to extract only the table ID from the value.
image.png
This formula uses regular expressions to extract the table ID. It looks for a string that starts with tbl followed by one or more word characters.
REGEX_EXTRACT({Open in Page Designer}, "tbl\\w+" )
Here are the button field and the formula field in a grid view.
image.png
Thank Kuovonne for creating this content!
Publish date: 2024-09-09

Share
 
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.