Repeating Group - Show all

I need help with a repeating group.

I currently have a RG with cases. It displays from a custom state on the page (lab_page) which sets a team which in term set a a list of cases.

I have also set a custom state to restrict the view to only show the cases where the current user is assigned .

However atm I can only show the cases grouped by their team - which I like, but I also want the current user to be able to see all the cases in the teams they belong to since one user can belong to many teams. I hope that makes sense. I have made a small video below to show you what I wan to achieve.

I can give you some suggestions… but firstly, does a Case belong to an “Assignee” or a “Team”?

In other words, if you moved someone from one Team to another, do their cases go to the other Team? Or vice-versa, if you move a Case from one Team to another, does the Assignee then become a member of that other Team?

A list of Case belongs to a team. A User can belong to several teams. List of Users are assigned to a case as assignees.


Does a Case belong only to one Team, or can it belong to multiple teams (you currently have it set up as a list field within Case).

I ask because if it has to be a list field, then you are having to do “list to list” searches (searching for a list of teams the user belongs to, and comparing that to the list of teams in each case). This is done via an advanced filter and performance can be bad. But if each Case only is in one team, then that opens up other (and more efficient) search possibilities.

A case belongs to one team. I added the team field in cases when trying to solve this.

In your Case datatype, put a field for Team (don’t make this a list field, it should just hold the reference to one team).

Then in your Case RG, in the Search for Cases box you can write a constraint that says either…

A) Team is in Do a Search for Teams. That will pull up a second search box where you can search for Teams that a User is in.

Or, B) if the User datatype has a list field containing the Teams for that User, you can write it as… Team is in Current User’s Teams

The second is more scalable since the first involves a nested search, and that constraint will get executed client side.

I’ll try and let you know

I tried Solution (B) but I get asked to complete the constraint


and I don’t know what to do next

For this approach to work, this part is key:

In other words, “This field is a list” can’t be checked.

image

Then you can write the expression as I have it.

One thing to know is that in this Search for box (which is where you should aim to have all your constraints when possible), that you can do a “one:many” search (whether a single thing “is in” a list of things) or a “many:one” search (whether a list of things “contains” a single thing), but you can’t do a “many:many” search.

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