Filter - excluding types

Hi Bubblers,
I have a repeating group which contains cases and can be filtered by status i.e. Pending, approved, processing, completed, delivered and on hold.
I don’t want to the RG to show non active status - completed, delivered and on hold - I have tried using status<> Completed… but that excludes them completely. I still want to be able to view and count them - especially when I choose to filter by that status

How can I go about achieving this.



I don’t want to the RG to show non active status - completed, delivered and on hold - I have tried using status<> Completed… but that excludes them completely.

I still want to be able to view and count them - especially when I choose to filter by that status

I’m not sure I understand…

Do you want to include non-active statuses in the RG or not?

I don’t want to show them to start with - but I want to be able to see them when I want to see them and sort by the non active status and count them too, because they are still cases.

Just add a constraint to your RG datasource then…

I’d use a custom state list to define the Statuses you want to include in the RG, and then use Status is in Custom State List on the RG data source search (or just use = a single value if that’s the UX you’re going for).

Obviously, you can’t be counting the RG items if you want to keep count of all of them, so your ‘counts’ will have to be done directly on the database, not on the RG’s list of things.

That’s because you are making constraints on the server-side (it returns to the client all things that are not “completed”).

So you can:

  1. Get all entries from the DB and filter on the client-side using :filtered operator. This approach is more impactful on performance (in case if you have a lot of “cases”).
  2. Use a custom state to store status and use it as a constraint. As I can see - user can choose only 1 status at a time (not a list of statuses). So I would create a custom state like “rg_status”. Default value = status you want to be default. When a status is clicked - update the custom state. And in the RG use this custom state as a constraint in your search.

Thanks for your suggestion. But how would I still be able to filter the list individually by status?

This topic was automatically closed after 70 days. New replies are no longer allowed.