pyairtable
pyairtable copied to clipboard
Unexpected behavior matching linked field
First, thanks for providing a nice, well-documented, pythonic API!
Matching to regular fields worked as expected, but I was having trouble matching a value to a linked field:
>>> components.first(formula=match({"Kind": "Disk"}))
{'id': 'rec0jwWAtqZHnuaIk', 'createdTime': '2022-06-15T18:31:24.000Z', 'fields': {'System ID': ['reclkZH8VPc9yQ3BN'], 'Make': 'Seagate', 'Kind': 'Disk', 'Serial Number': 'Z1234ABC', 'Model': 'ST1000NM0033-9ZM', 'Description': '1000GB', 'Name': 'Disk-Z1234ABC', 'Name (from Systems)': ['somehostname']}}
>>> components.first(formula=match({"System ID": "reclkZH8VPc9yQ3BN"}))
>>> components.first(formula=match({"System ID": ["reclkZH8VPc9yQ3BN"]}))
Traceback (most recent call last):
{snip ...INVALID_FILTER_BY_FORMULA...}
If I search by the real value of that System ID
(in this case it is an integer) and not the API's hashed record value, then it works properly. Given that the output contains the record hash (and not the value of the link) amongst all of the other values, I was expecting to be able to search by that as well.
Related: #50
Did you manage to solve this?
@NicoHood I had to work around it by searching for the value of the linked field, and not the hashed record value.
And what about the formula RECORD_ID()
?
I'm not able to reproduce this issue, but please feel free to add more detail if it's still a problem for you and we can look into reopening it.