Date range filter on a table

I was able to successfully load data from Airtable using the api. I am trying to filter records within a date range. I created a date range component, and I tried two methods to filter the data in the table.

In the first method, I tried Airtable's filterByFormula IS_AFTER function, but it does not look like it supports this exact type of filter.

In the second method, I used the event handling on the date range component to set a filter on table. I set up two events. The first event sets the filter "is after", which uses filters after a specific date. The second event sets the filter "is before", which sets the filters before a specific date. It appears the filter created by second event overwrites the filter created by the first event. The filters also accumulate, so I need a way to clear out all of the other filters. I could do this with another event, but it starts to feel like a broken design.

Can anyone help me with either approach?

Welcome to the forum!
When using an event handler to filter the table's original data you could use the filter functions that are built in to the table...
Is it a new table component? or a legacy table?

Hi ScottR, Thank you for responding.

It is a new table component. I just started building the app last week. For usability reasons, we want to have the date range filter at the top of the app. We will also be using the data in api requests.

So what you would want to do use setFilterStack

1 Like

Thanks ScottR, I was able to make it work using the setFilterStack in a custom script. I appreciate you pointing me in the right direction.

1 Like