Save the date! Join us on October 16 for our Product Ops launch event. Register here.
Jan 13, 2022 06:25 PM
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
Jan 15, 2022 03:57 AM
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.
Jan 24, 2022 04:06 AM
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?
Feb 06, 2022 07:02 AM
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.