How to filter records in Airtable API using filterByFormula parameter

I’m trying to use the Airtable API to search for specific records in my database table. I want to use the filterByFormula parameter in my GET request to find matching data.

Here’s the API endpoint I’m working with:

api.airtable.com/v0/BASE_ID/Products?filterByFormula=(FIND("Smart device will help when feeling overwhelmed",{Customer_Request}))&api_key=YOUR_API_KEY

When I test this request, I keep getting this response:

{
    "error": {
        "type": "INVALID_FILTER_BY_FORMULA",
        "message": "The formula for filtering records is invalid: Invalid formula. Please check your formula text."
    }
}

I’ve been testing this using Postman but can’t figure out what’s wrong with my formula syntax. Can someone help me understand how to properly format the filterByFormula parameter for searching text within a field?

This looks like a URL encoding issue with your formula. When you use FIND in filterByFormula, special characters and spaces need proper encoding. Try URL encoding your whole formula parameter. Those spaces and parentheses in your search string need converting to their URL-encoded versions: %28FIND%28%22Smart%20device%20will%20help%20when%20feeling%20overwhelmed%22%2C%7BCustomer_Request%7D%29%29. Easier fix: if you’re using Postman, just put the filterByFormula value in the Params section instead of typing it straight into the URL. Postman handles encoding automatically. I’ve hit this same problem before and that usually fixes the invalid formula errors. Also make sure your field name Customer_Request matches exactly what’s in your Airtable base - check for any underscores or spaces.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.