Help

Re: How to add multiple filters through API URL?

Solved
Jump to Solution
1991 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Kartik
6 - Interface Innovator
6 - Interface Innovator

I was wondering if it’s possible to add multiple filters in the Airtable API URL - I have figured out the way for one filter, but I am struggling to apply multiple filters. Here’s the URL I made, which has a single filter applied :

api.airtable.com/v0/<BASE_ID>/<TABLE_NAME>?api_key=<API_KEY>&filterByFormula={City}="MUMBAI"

The above URL works perfectly, but if I try to add another filter (using &), it shows errors.

I am looking for a way to add these 3 filters :

  • {City} = “MUMBAI” (field type = single line text)
  • {Age} > 25 (field type = number)
  • {Calculation} = “Ok” (field type = formula, result would be either “Ok” or “NA”)

What is the recommended/correct way to add multiple filters? Your guidance would be very appreciated. Thanks!

1 Solution

Accepted Solutions
ROARK
6 - Interface Innovator
6 - Interface Innovator

Hi Kartik,

yes, that’s possible.

You can have only one filterByFormula parameter.
But you can treat filterByFormula just like a regular Airtable formula field.

You could try it like this:

&filterByFormula=AND({City}="MUMBAI",{Age}>25,{Calculation}="Ok")

Quick tip: if you are unsure about whether your formula will work, just create a new Airtable formula field and test it there. I often find this a quicker way to spot errors in a formula than debugging it with API calls.

This is also a good tool to automatically create properly encoded urls with the correct parameters.

See Solution in Thread

1 Reply 1
ROARK
6 - Interface Innovator
6 - Interface Innovator

Hi Kartik,

yes, that’s possible.

You can have only one filterByFormula parameter.
But you can treat filterByFormula just like a regular Airtable formula field.

You could try it like this:

&filterByFormula=AND({City}="MUMBAI",{Age}>25,{Calculation}="Ok")

Quick tip: if you are unsure about whether your formula will work, just create a new Airtable formula field and test it there. I often find this a quicker way to spot errors in a formula than debugging it with API calls.

This is also a good tool to automatically create properly encoded urls with the correct parameters.