Help

Re: Date range filter with other filters on API call is not working kindly help me out to solve this problem

Solved
Jump to Solution
1281 0
cancel
Showing results for 
Search instead for 
Did you mean: 
James_Rodriguez
4 - Data Explorer
4 - Data Explorer

I have integrated the Airtable API in my Wix site which was working fine with other filters but when I implemented date range filter with those filters then it’s showing empty items in response and here is the URL of my request
https://api.airtable.com/v0/appGS7oZJd8MLqWKc/Candidates?filterByFormula=AND(({City}=‘Benton’),AND(I...))&api_key=“key_provided_by_airtable”.
I checked that on Airtable data UI by applying the same filter and it’s working fine over Airtable UI but not working in API calling when I applying the same filter via API.

1 Solution

Accepted Solutions
Bill_French
17 - Neptune
17 - Neptune

Hi @James_Rodriguez and welcome to the community!

Just to be clear, filterByFormula parameters MUST be URL-encoded. Dates without quotes is one issue; lack of URL-encoding is another.

Typically your scripting environment where you make the API calls will provide a method for URL-encoding and some languages refer to it as URI-encoding.

See Solution in Thread

4 Replies 4

Hi @James_Rodriguez - you need to quote your dates, so instead of this:

&filterByFormula=IS_BEFORE(%7BDate%7D%2C2020-06-15)

do this:

&filterByFormula=IS_BEFORE(%7BDate%7D%2C%222020-06-15%22)

Not sure of you have some across this, but you can use this codepen to encode your API urls:

Bill_French
17 - Neptune
17 - Neptune

Hi @James_Rodriguez and welcome to the community!

Just to be clear, filterByFormula parameters MUST be URL-encoded. Dates without quotes is one issue; lack of URL-encoding is another.

Typically your scripting environment where you make the API calls will provide a method for URL-encoding and some languages refer to it as URI-encoding.

@Bill.French Thanks a lot sir now it’s working fine when I implemented quotes around the date! I really appreciate your quick response :thumbs_up: :thumbs_up:

Excellent, but please mark this solved by @JonathanBowen as he assessed the true cause.