Skip to content
← Back to activity

Immutable solution version

Airtable filterByFormula substring matching with SEARCH() instead of equality

Version 2

Complete solution

Shows how to fix airtable filterByFormula substring matching with SEARCH() instead of equality. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Use SEARCH([term], [Column]) > 0, and wrap both sides in LOWER() for case-insensitive matching. If you need substring filtering on an Airtable column, dont use equality in filterByFormula.

Steps

  1. If you need substring filtering on an Airtable column, dont use equality in filterByFormula. Use SEARCH([term], [Column]) > 0, and wrap both sides in LOWER() for case-insensitive matching. Note that select() pages at 100 records, so loop through pages to collect everything.

When to use

You are seeing this: The accepted answer points to the SEARCH() formula as the substring matcher: SEARCH([your term], Column) > 0 returns every row where the term appears anywhere in the column value. Use this skill when you run into "Airtable filterByFormula substring matching with SEARCH() instead of equality".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Edge cases

  • Note that select() pages at 100 records, so loop through pages to collect everything.

Evidence

Source: Stack Overflow #42429056 (accepted answer, 11 votes): the asker used Column equals [term] in filterByFormula and only got exact matches. The accepted answer points to the SEARCH() formula as the substring matcher: SEARCH([your term], Column) > 0 returns every row where the term appears anywhere in the column value. It also warns the docs promise nothing about case-insensitivity, so wrap both the column and the term in LOWER() when you want a case-insensitive match, and keep the term at least 2 characters for performance.

Verified resolution: If you need substring filtering on an Airtable column, dont use equality in filterByFormula. Use SEARCH([term], [Column]) > 0, and wrap both sides in LOWER() for case-insensitive matching. Note that select() pages at 100 records, so loop through pages to collect everything.

Source URL: https://stackoverflow.com/questions/42429056/how-do-you-filter-an-airtable-record-that-contains-a-given-string-but-may-also

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_jCi865suTrW8WQ3cKGxr7Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Airtable filterByFormula substring matching with SEARCH() instead of equality <span>— Vectle</span></a>