0

I want to implement URL for search specific data in my base using filterByFormula below are my link and I got an error and how to resolve that

my url:

api.airtable.com/v0/APPID/Stories?filterByFormula=(FIND(“Car (in robot form) will offer a hug when I am stressed out”,{User want}) &api_key=MYKEY


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

I tried using postman, please help me.

Dev
  • 2,739
  • 2
  • 21
  • 34
Manoj Madushanka
  • 371
  • 1
  • 7
  • 21
  • You are missing a closing parenthesis. Either remove the one before `FIND` or add one after `{User want})`. You can generally check a formula's validity by creating a new formula field in your Airtable base and putting the formula there. If it works in the base, it should work in the API. – TheF1rstPancake Dec 30 '19 at 21:59

1 Answers1

0

While querying filtered data from Airtable via API, you don't have to use FIND keyword. You can filter data with simple Airtable formula like structure. For example,

{Email} = 'johnwick@neverdie.com' 

Above filter retrieve all the records from the table whose Email is simply johnwick@neverdie.com

To limit number of records retrieve by API maxRecord parameter is available for that. For more info about various parameters please refer my answer here AirTable API Find record by email or official Airtable API Documentation

In your case

API url would be structured like,

api.airtable.com/v0/APPID/Stories?filterByFormula=Car+(in+robot+form)+will+offer+a+hug+when+I+am+stressed+out%3D%22User+want%22&api_key=MYKEY

For more info about Airtable API encoding, check this https://codepen.io/airtable/full/rLKkYB?baseId=app1C5TVoophmmr8M&tableId=tblvILr4aSAYI98oa

Hope this helps!

Aditya
  • 3,525
  • 1
  • 31
  • 38