Help

Python wrapper API error

Topic Labels: API
4762 3
cancel
Showing results for 
Search instead for 
Did you mean: 
nnnnneil
8 - Airtable Astronomer
8 - Airtable Astronomer

I’m using the python wrapper (here).

I have a small script that tries to update a field in the ‘Orders’ table. The record is successfully retrieved earlier from the API so I have the ID of the record stored in ‘orderid’. I’m now trying to update 1 field called ‘Folder’ to ‘True’.

record = airtable.search('id', orderid)
fields = {'Folder': 'True'}
airtable.update(record[id], fields)

But i receive this error which i’m stuck at:

requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.airtable.com/v0/appoR6kS5KY3cJdwK/Orders?filterByFormula={id}='rec70yhW5MYcetmxJ' (Decoded URL) [Error: {'type': 'INVALID_FILTER_BY_FORMULA', 'message': 'The formula for filtering records is invalid: unknown field names: id'}]

3 Replies 3
Andrew_Johnson1
8 - Airtable Astronomer
8 - Airtable Astronomer

Your error suggests that there is no field name ‘id’ present in your base.
You will need to explicitly create a filed called ‘id’ in your base and set the type of that field to ‘formula’. Then set the formula to RECORD_ID()
After that it should be smooth sailing

Cheers!

nnnnneil
8 - Airtable Astronomer
8 - Airtable Astronomer

Thanks. I figured it out!

Evos_World
6 - Interface Innovator
6 - Interface Innovator

Hi

I’m just getting started with this but don’t know anything about APIs at the moment.

Could you share the files you use so I can connect to my base using my API key and see a working version

Thanks