I need help with checking if a customer already exists in my Airtable database before creating a new entry. I want to search by email address first and only add the customer if they don’t exist yet.
But that gives me a different error saying select only accepts one parameter and I should use eachPage or firstPage instead. What’s the correct way to do this?
Had this exact same issue last month. You’re mixing up Airtable’s methods - find() needs a specific record ID, but select() is what you want for filtering. And replace() won’t work without an existing record ID.
Here’s what fixed it for me: use select() with eachPage() instead of firstPage(). I’ve found firstPage() can be flaky with certain filters:
Two problems with your code. First, your FIND formula is wrong - you’re treating it like an equality check when FIND searches for text positions in strings. Second, you’re calling replace() without a record ID.
Hit this same issue months ago. Here’s what works:
Async/await beats callback hell every time. Switched to double quotes in the formula too - single quotes break with email addresses that have apostrophes.
Double-check your Airtable field is named “emailAddress” and not “Email” or something else. That 404 usually means field names don’t match.
Hit this same issue a few weeks ago. You’re using find() which needs a record ID, not a search query. That FIND formula syntax is for searching text strings, not exact matches.
Something others missed - you’re calling replace() but that needs the record ID as the first parameter, which you don’t have. Use create() for new records instead.
Watch your field names too. Mine worked fine in testing but crashed in production because my Airtable field was “Email Address” with a space, not “emailAddress”. The error won’t tell you this.
Log your exact field names from the Airtable schema first, then try the select approach others mentioned. The all() method from the latest answer is probably cleanest since it handles pagination without callback headaches.
your FIND syntax is completely wrong. FIND searches for text inside strings - it doesn’t compare values. just use {emailAddress} = '${emailAddress}' and drop the FIND wrapper. also double-check that your field name matches exactly what’s in Airtable - it’s case sensitive!
Your filterByFormula syntax is wrong, and you can’t use find() like that. Airtable’s find method needs a record ID, not a filter formula. Use select with firstPage to search by email instead.
Double-check that your email field name in Airtable matches what you’re using in the formula. The {Email} syntax with curly braces works better than bare field names.