Help

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.

Airtable API: List Records filters identified by field id not field name

Topic Labels: API
1710 3
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi all,

This forum has been a huge help in getting me unstuck in many instances.

I haven’t found an explicit answer for this one, so posting here.

I have an API call to the Airtable API in which I am looking to retrieve a record that matches on a specific field value (not the record id) and I am looking to identify that field by it’s field id rather than it’s field name.

Is this possible? If so, what would be the proper syntax?

For clarity here a sample syntax with field name as the identifier.

NOT({Field Name} = ‘data’)
ergo appending option of filterByFormula=NOT%28%7BField%20Name%7D%20%3D%20%27data%27%29

3 Replies 3

I’m confussed, you say you want to use Field ID instead of Field Name, but in the example you use Field Name.

Also, why you want to use field ID? Anyway, the filterByFormula parameter allows to use a standard formula that would work in the graphic interface, and there you can reference Field ID.

Thanks for the reply!

To clarify. The above example was given as the scenario I currently have, but that I don’t want.

So currently I have
NOT({Field Name} = ‘data’)
ergo appending option of filterByFormula=NOT%28%7BField%20Name%7D%20%3D%20%27data%27%29

But I would like to replace the {Field Name} with the {Field ID}

The purpose for this is to bring more robustness to the API request - i.e. in case someone changes the name of the {Field Name} this would still work as the {Field ID} is used to identify the field in question.

Could you please explain how you would use filterByFormula in this scenario?

You cannot do this with filterByFormula which requires a valid formula, which must use field names, not field IDs.

If you have access to the Meta API, you can use that to convert field IDs to field names. However, I do not know if Airtable is still providing access to the META API.