pyairtable icon indicating copy to clipboard operation
pyairtable copied to clipboard

Unexpected behavior matching linked field

Open ryanlovett opened this issue 2 years ago • 3 comments

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

ryanlovett avatar Jun 15 '22 22:06 ryanlovett

Did you manage to solve this?

NicoHood avatar Jul 08 '22 06:07 NicoHood

@NicoHood I had to work around it by searching for the value of the linked field, and not the hashed record value.

ryanlovett avatar Jul 08 '22 06:07 ryanlovett

And what about the formula RECORD_ID()?

NicoHood avatar Jul 08 '22 07:07 NicoHood

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.

mesozoic avatar Jan 21 '24 05:01 mesozoic