Skip to main content
Solved

Tip: How to get a Field ID from GUI for use in API

  • October 2, 2018
  • 10 replies
  • 580 views

Forum|alt.badge.img+9

Hi! I found a workaround that’s helpful for me, so I thought I’d share. If someone has an easier way to do this, please let me know! Apologies if this has already been posted, I didn’t find it after a bit of searching.

The problem I was trying to solve was that when updating a record, a field can be named using its friendly name (e.g. “First Name”), but then if I change it later, even a little bit, my API integration will break. Each field also has a unique ID, prefaced by fld, but I wasn’t aware of any way to actually find that name.

Well, it turns out that you can for most fields, with a little trickery:

Edit: See drassi’s post below for an easier way to do this.

  1. In the GUI, create a new field, and make it a formula. In the formula, refer to the field that you want to know the ID of. (For instance, if you want to know the ID of the “First Name” field, make your formula “{First Name}”.)

  2. Delete the field that you want to know the name of. Now, the formula field will have a red error icon, and when you pull up your formula, the formula will say “{column_value_fldxxxxxxxxxxxx}”. The fldxxxxxxxxxxxx part is your field ID.

  3. Undo the field deletion. Everything will be back the way it was before, nothing will have been harmed by temporarily deleting the field.

This works for any field except the first column, which can’t be deleted as it is the primary key.

Now, you can refer to fldxxxxxxxxxxxx in your API calls and it won’t matter if it gets renamed!

Best answer by Emmanuel_LOUISY

The best way I found is to go to https://airtable.com/YOUR_BASE_ID/api/docs
There you will have a complete documentation with tables ids and fields ids

/api/docs

10 replies

Forum|alt.badge.img+19
  • Inspiring
  • 351 replies
  • October 2, 2018

hmm, could you not just use the RECORD_ID() function in your formula? I think thats all you need.


Forum|alt.badge.img+9
  • Author
  • Known Participant
  • 16 replies
  • October 2, 2018

hmm, could you not just use the RECORD_ID() function in your formula? I think thats all you need.


That returns the ID of the record(the row, in the user interface), not the ID of the field (the column, in the user interface).


Forum|alt.badge.img+19
  • Inspiring
  • 351 replies
  • October 2, 2018

That returns the ID of the record(the row, in the user interface), not the ID of the field (the column, in the user interface).


ah, gotcha. ok, that is a nice hack :slightly_smiling_face:


Forum|alt.badge.img+14
  • Inspiring
  • 38 replies
  • October 11, 2018

Great find! This is a neat trick to prevent script errors, thanks for sharing.

You can actually find these field IDs a bit faster using your browser inspector, just inspect the header cells and you’ll find a data-columnid html attribute that reveals this field ID. This also allows you to get the ID for your primary key, if that’s ever of use.


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • March 3, 2020

And now there’s an even easier way, thanks to Scripting block.

Of course, the Scripting block will require a paid subscription, whereas the Standard API is free.


Forum|alt.badge.img+9
  • Author
  • Known Participant
  • 16 replies
  • March 4, 2020

And now there’s an even easier way, thanks to Scripting block.

Of course, the Scripting block will require a paid subscription, whereas the Standard API is free.


I believe that all these methods are probably less ideal than using the Metadata API if that is an option.


Samir_Ghosh
Forum|alt.badge.img+16
  • Known Participant
  • 26 replies
  • December 27, 2021

I believe that all these methods are probably less ideal than using the Metadata API if that is an option.


Unfortunately, the Meta API is only available server-side (i.e., call from backend): " Client-side requests are not allowed"


Alexey_Gusev
Forum|alt.badge.img+25
  • Brainy
  • 1261 replies
  • January 17, 2022

copied from FB comments, quick steps

field IDs of current active table:

output.table(base.getTable(cursor.activeTableId).fields)

find field in a base when you know ID

const FIELD='PUT_ID_HERE'
let table=base.tables.find(t=>t.fields.some(f=>f.id==FIELD))
output.text(table?.name+'/'+table?.getField(FIELD).name)

Forum|alt.badge.img
  • New Participant
  • 1 reply
  • Answer
  • March 11, 2022

The best way I found is to go to https://airtable.com/YOUR_BASE_ID/api/docs
There you will have a complete documentation with tables ids and fields ids

/api/docs


Forum|alt.badge.img+2
  • Participating Frequently
  • 5 replies
  • March 14, 2024

There is now a simple way to do it in the OOTB GUI.

In your workspace head to the right and click on the "tools" drop down, then select "manage field" and then use the filter option on the right hand side of the screen to show the Field ID (toggle visibility)