Scalability of filtering repeating groups using states

Hi,

I have a repeating group, which has filters using :filtered and also 2 checkbox filters which handle more complex filtering in one go.

At the moment I have 2 custom states for each of the checkboxes, and 3 conditionals ( Display data filtered by X, Display data filtered by Y, Display data filtered by X & Y) in the rep group which determine which data is to be displayed (as well as the :filtered) . I need to be able to have several more checkbox filters, but the number of conditionals required would be exponential for anything beyond 3 conditionals.

Any help greatly appreciated.

Thanks
Alan


image

Hard to give exact advice without seeing how your database is set up.

Looks to me though like you may also need to show what those filters are on the searches.

You also need to consider that when you have these 3 conditionals the Checkbox Held is checked is going to be yes when Checkbox Comments is checked and Checkbox Held is checked. Also, Checkbox Comments is checked is yes when Checkbox Comments is checked and Checkbox Held is checked, so you need to add an and operator to the first two conditionals so that it is Checkbox Held is checked and Checkbox Comments is not checked and vice versa.

This post may help you

But definitely put up some screen shots of the filters and your database structure which are both related to how the search results will be returned and how to set it up properly overall

Thanks, I have added some screenshots below. The type “invoices”, has a lot of data types involved, it’s quite a complex set of flags, hence the need for more filtering.
I read your post, but it looks like it is all for user inputted filters? If I was to add another checkbox, I would need to add about 12 different conditions for all the different possible combinations.
There must be an easier way around this! Thanks.


I ran into a similar issue although I was only dealing with 3-4 check box filters, but I think it would work with any number. In order to achieve was I was trying to do I created separate states for each checkbox. I was filtering users so I had a “User” state for each checkbox. I created a custom workflow to update each of these states that would trigger whenever the items in the list were opened or modified. Each state filtered the full list to only those that met that single checklist’s category. I then set the master repeating group to aggregate all of the checkboxs’ User states into one list. Hope this helps.

Hi @josh.nosal,

Thanks - are you able to share some screenshots of the repeating group’s data search criteria, and of the workflow for one of the custom states?
I’m still unsure how I can link the two properly without using conditionals.

Thanks for your help!

Re: scalability I think your setup would work OK with a few conditionals and a shorter list. But with a lot of data or conditionals, probably not ideal.

You could keep all this server side (via the do a search for box) – which is most scalable. Trouble is for a yes/no field it will return all yes’s or all no’s, even though you really want it to be everything if unchecked, or only the “yes’s” if checked. To accomplish that I used a custom state for the checkbox which has “yes” if checked and blank if unchecked. The blank entry is ignored using the ignore empty constraints. (There may be a more elegant way of doing it – I recall a “cool with bool” video in the forum I haven’t yet watched.)

I try to avoid :filter whenever possible since it’s client side. But if you really want to use a :filter and you find yourself with a bunch of checkboxes, you could run a workflow that sends the data to the RG and kicks off when a checkbox is changed, and the worfklow has multiple filtering steps that apply based on conditionals.

@alan.mackintosh1 Sorry for the delay. Here is the screenshot of the table I am working with. You can ignore the conditions since those are sorting rather than updating contents. Each of the three check boxes above are in their own group that has a state called ‘Users’.

Whenever one of those checkboxes is checked, I trigger a custom function that updates the ‘User’ state for each of those checkbox groups.

image

That custom function runs through each checkbox and says if this checkbox is checked, I’ll pull this type of user from the master list and add it to this checkbox group’s custom state.
image

Now, if you look back up at the first image, you will see that the repeating group in the User table is pulling from each one of these checkboxes’ User states. If you have a ton of checkboxes, you will need to pull from quite a few states, but at least you only need to pull once and not write a condition for each one.

Apologies if this is tough to follow. I’ll admit this is my first screen shot post.