Jul 22, 2022 04:24 AM
Hi, I want to query and filter a table based on several filters sent via the URI as parameters.
I found the Airtable API doc suggesting that I use the AT API encoder and use FIlterByFormula.
I tried it and it all works perfectly. but for only one formula. meaning it only works for one column. but I have around 8 columns I want to query.
How can I add more than one FilterByFormula in the URI?
If the URI Looks like this:
“https://api.airtable.com/v0/app0uHEtrxyWp3uzn/tbl1MB1FIAfGmnX4I?api_key=NULL&filterByFormula=REGEX_M...”
how can I make it like:
“https://api.airtable.com/v0/app0uHEtrxyWp3uzn/tbl1MB1FIAfGmnX4I?api_key=NULL&filterByFormula=REGEX_M...”
And keep adding appending to it, This is me testing it on Postman.
When I try to add more than one Formula:
Solved! Go to Solution.
Jul 22, 2022 11:49 AM
He @Vivid-Squid Thank you for the response.
I have figured it out.
Indeed you must use AND(). URI will be formed as follow:
filterByFormula=AND(expression1, expression2)
eg: …?filterByFormula=AND(SEARCH(“like”, “like me”), {price} > 100, …)
In case someone runs into the same issue.
Jul 22, 2022 08:45 AM
Hi @Partnerships_Content,
I do not know if you can have more than one filterbyformula in a URL. I think you need to place an AND() in your one formula.
This page will help you build out the proper URL: https://codepen.io/airtable/full/MeXqOg?baseId=appQQtcKJH671c8ga&tableId=tblxBd3hOHeysr9EY
Jul 22, 2022 11:49 AM
He @Vivid-Squid Thank you for the response.
I have figured it out.
Indeed you must use AND(). URI will be formed as follow:
filterByFormula=AND(expression1, expression2)
eg: …?filterByFormula=AND(SEARCH(“like”, “like me”), {price} > 100, …)
In case someone runs into the same issue.