So I have two mulitselect components:
-
One that filters a column called restaurants
-
One that filters a column called codes
So I have js script that sets a filter for restaurants:
restList.setFilter({columnId: "restaurants", value: filterRest_Multiselect.value, operator: "isOneOf", id: "restfilter"})
the other script for codes is the same and I have an event handler to clear the independent id for each filter when the length of multiselect component is zero.
My issue is that when you set one filter then you set the next filter, retool assumes that you want to use the logic operator "and", where as in this case I want retool to assume I want the "or" logic operator, and I do not know if that is possible to change via settings.
So I know there is a default operator setting for tables but that only works if you have a default filter set in place which is not the case here.
I tried using the filter stack so that when you set the filter for one component you set the value for the other component to zero/blank but the issue there is that when you clear the filter of the component you set, the filter stack is looking for when the two columns are blank, creating a blank table.
So tracing my desired functionality, if I set restaurants multiselect to 1, it finds restaurant 1, then if I set codes multiselect to 10000, it finds all restaurants tied to code 10000 and includes restaurant 1 since the logic operator is or. Then clearing the restaurants mulitselect removes filter looking for restaurant 1 and shows rest. tied to code 10000 only, then removing code filter will go back to tables original state, showing all restaurants.
Any help will be very appreciated !!!!