Welcome to the Airtable Community! If you're new here, check out our Getting Started area to get the most out of your community experience.

Field ID instead of Field Name?

Topic Labels: Scripting extentions
4643 7
Showing results for 
Search instead for 
Did you mean: 

I’ve been testing out the Scripting block over the past few days. This is the most exciting thing to happen to Airtable…since Airtable :slightly_smiling_face:

Does anyone know of a way to make the scripts resilient to changes in a table’s field names?

For example, if I have the following code in a script:

fname = record.getCellValue(“First Name”);

this works great until someone decides to rename the “First Name” field to “Contact First Name” – at which point the script will no longer work.

I’m wondering if there is some sort of “internal ID” for a field that stays the same even if the visible field name is changed.


7 Replies 7

Not as far as I can tell. You can get the list of field names from the table, but I don’t see any other internal id. You could compare the field name in your code to the list of field names, and fail gracefully if it isn’t there. It would probably be easier to strictly limitCreator privileges and warn people to not change things.

You can see the underlying field IDs using this script:

for (const table of base.tables) {

Screen Shot 2020-02-29 at 8.03.10 PM

You can substitute the IDs for the names in the API, e.g. record.getCellValue(fieldId)

Super helpful! Thanks Kasra!

I figured that I would want to make my table references resilient to name changes as well, and found that this additional code provided me the table ids.

for (const table of base.tables) {


    output.text(; // table ID



I just realized that this underlying field id is what replaces the field name in a formula after the field is deleted. I had wondered where those strings came from. Of course, knowing the field id only after the field is deleted isn’t very useful.

I wonder if the field id from the Airtable Scripting API works in the Airtable Standard API.

Eta. Looks like it does according to this topic.

If you want to initialize an object for use in your code later, you can get all the ids in an object like this:

let allTables = {};
for (const table of base.tables) {
    let newObject = {} =;
    for (const field of table.fields) {
        newObject[`${}`] =
    allTables[`${}`] = newObject;

I’ve come across the same issue where I need a unqiue ID for each record.

Just found the Autonumber field type. Is there a reason why you’re not using this?

Slightly better:

for (const table of base.tables) {
    output.markdown(`# ${} (${})`);