Contains function in list

Hi,

I have an overview of groups that contain user information. In the user overview, you can filter by username using the “text a contains b” function. However, I’m having trouble filtering in the group overview with student information. The “list a contains b” function needs to be used for this, but unlike the “text a contains b” function, it only shows groups when a name is fully typed out. I’m wondering how I can solve this problem so that it filters the same way as text filtering

1 Like

Hi Albert,

The List A contains B function indeed works only with 100% matches to items in the list. If I understand correctly, you want to show a list of groups that a student is in, by typing (part of) their username.

In other words, you have a GROUP which contains USERS and they have a USERNAME. I assume that groups can contain multiple users and users can be in multiple groups. You cannot easily search in the members of the group on a partial name on a page, however there is a solution:

Solution
Every time you add a user to a group, or remove a user from a group, update a text property in the group data item where you store a list of the usernames. This way, you can filter with the Text A contains B function on this property. Now you can search for users in the group, directly on the page.

To make a flow part that handles updating this list, do the following:

  1. Add a property called User search text to the data item Group
  2. Make a flow part called Update user search text for group with a Group as input
  3. Add an action that empties the User search text property
  4. Add a repeat action that goes through each User of the group
  5. In the repeat action, make a calculation: Concatenate Group / User search text with Concatenate User / Name with ,
  6. In the repeat action, make an edit action that updates the Inputs / Group / User search text with the result of the action under point 5.

Use this flow part whenever you make changes to the users in a group.

1 Like

How would this work for dates? If I have a start and end date, it should display the groups that have users with the dates and in between.

Currently that is not possible I think, unless you implement the search in a flow part and submit the search form. Then on the next page, after the flow part gives you the results, show those results from the flow part output.

Hope that helps!

1 Like