Hi,
i am using python-requests and trying to use f-string with filterByFormula here is a simple implementation:
hard coding the name worked:
url=f"https://api.airtable.com/v0/{base_id}/{table_name}/"
headers={'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'}
query={"filterByFormula":"({full_name}="some name")"}
response=requests.get(url, headers=headers, params=query)
data=response.json()
but when i tried to use f-string it didn't work. here is a a piece of code where the problem occurred:
url=f"https://api.airtable.com/v0/{base_id}/{table_name}/"
headers={'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'}
employee_name="some name"
query={"filterByFormula":f"{{full_name}}={employee_name}"}
response=requests.get(url, headers=headers, params=query)
data=response.json()
{'error': {'type': 'INVALID_FILTER_BY_FORMULA',
'message': 'The formula for filtering records is invalid: Invalid formula. Please check your formula text.'}}
i wish somebody can help me with this
thanks