Nov 06, 2019 06:51 AM
Hello,
I am getting below data, but I need to filter data where ‘Start Date’ is between 01-Jan-2019 till 31-Dec-2019. How can this be achieved?
{
"id": "recxxxxxxxxx",*
"fields": {*
"Priority": "N",*
"Month": "2019-03",*
"Week of the Year": "10th",*
"Start Date": "04-Mar-19",*
},*
"createdTime": "2019-01-11T22:22:09.000Z"*
}*
Nov 07, 2019 05:03 AM
Hi @Umapathi_PATANA - I’m assuming from your question that you are using the AT API. If so, you need to apply a filterByFormula
parameter to your API call. Not exactly the same as your scenario, but this works for me:
https://api.airtable.com/v0/YOUR_APP_ID/YOUR_TABLE_NAME?maxRecords=3&view=YOUR_VIEW&filterByFormula=IS_AFTER(%7BYOUR_DATE_FIELD%7D, '2019-01-01')
So some combination of IS_AFTER and IS_BEFORE should do the trick.
(Aside - the %7B
and %7D
characters are curly braces encoded for the URL)
JB
Nov 07, 2019 05:04 AM
Also, I would format the date field “YYYY-MM-DD”. It might work with your format, but possibly safer to go with the above (you could have another date field formatting the first, just for the API, if you need your format above in the UI).
Nov 07, 2019 05:17 AM
Actually, not even sure you need the curly braces. It works without.