Filtering using conditon group not updating without refresh

I would like to run a filter on a datagrid conditional on a box being checked. (i.e.: Show expired items only if box is checked). I can get the filter to work fine if I manually toggle the conditional grouping on and off. However, once I link it to the check box with a if then statement if I click the box nothing happens, but if I then refresh the filter is applied. I have other filters that work just fine but do not use the conditional group. Will changing the conditional group not automatically filter the datagrid like other filters?

Hey @jreinagel :wave:
Depends on where you put that filter :slight_smile:
There are several places where you can do that, including:

  1. At the collection level
  2. At a repeated list level (formula)

Each of them having pros and cons.

In your case, I believe you are applying the filter at the collection level. If you do that, everytime you modify the filter, you’ll need to retrigger a collection fetch using the workflow action Fetch collection.

Actually I am running the filter at the collection level when I bind the data. I use the filter and then select Conditional group which you can toggle on and off. However, if I do it programmatically it does not update the data in the table. Unlike if you just use a straight filter where X=Y it works in real time.

Yes, that’s because you’ll need to refetch the collection if the filter changes (in your case, if your variable bound to a value in the filters changes).
When you are modifying the filters in the collection settings, it refetches the collection.

Got it. I understand now. Thanks!

1 Like

Is there a way to have the filters in my collection refresh without adding a fetch task? I’m worried that this can make my webapp become slow if the collection has lots of data. In my instance, I’ll be dealing without thousands of transactions for some users

Hey @Msanders4
Best practice is to limit the number of items shown in your page to improve performance. So you only fetch the items that the user will see. And load the rest as the user requests for more items (with a pagination system for instance)

I ended up creating my own workaround. I don’t want to use backend filters because this means Weweb would have to make an API call to all of my users’ transactions every time they applied different filters, and this would make the user experience extremely slow, especially when somebody is dealing with thousands of transactions