I’m working with the Airtable API and trying to filter my data based on linked records. My table has a field that connects to another table and allows multiple linked entries.
I want to use the API to get only the rows that contain a particular linked record in this field. I’ve been experimenting with different filter formulas but nothing seems to work.
Here’s what I tried so far:
{LinkedField} = "rec123456789"
FIND("rec123456789", ARRAYJOIN({LinkedField}, ",")) > 0
Both of these approaches return zero results even though I know there are matching records in my table. I thought the linked field would contain an array of record IDs as strings, so I based my filters on that assumption.
What’s the correct way to write a filter formula that checks if a specific linked record exists in a multi-select linked record field? Any help would be appreciated!
This is super common when you’re getting started with Airtable’s API filtering. Your current approach won’t work because linked record fields don’t act like regular text strings in formulas. When you reference a linked field directly, Airtable gives you the primary field values from those linked records, not their record IDs. Try this formula instead: {LinkedField} = "rec123456789" - this works fine for single linked records. Multiple linked records get trickier since you might need to check each position. Honestly, Airtable’s formula system gets messy fast when filtering linked records through the API. I’ve found that using OR({LinkedField} = "rec123456789", {LinkedField} = "rec987654321") gets complicated quickly with lots of records. If your dataset isn’t huge, just pull everything and filter client-side - it’s way easier.
The problem is that linked record fields don’t work like you’d expect in API filters. I’ve hit this same issue tons of times.
Don’t try matching record IDs directly. Instead, use the primary field value from the linked record. If your linked table uses “Company Name” as the primary field:
{LinkedField} = "Acme Corp"
For multiple linked records:
SEARCH("Acme Corp", ARRAYJOIN({LinkedField})) > 0
This searches for the primary field value in the joined array.
Need to filter by record ID? Here’s a workaround: create a formula field in your linked table that returns RECORD_ID(), then reference that field in your filter.
Honestly though, after dealing with Airtable’s API weirdness for years, I usually just pull the data without complex filters and do the filtering in my app code. Way less frustrating and much more reliable.