Transfer elements of repeating groups

Hi there. A feature of my application is to create groups of users. For this I have developed the screen in the picture. The repeating group shows the users found by the search input. The repeating group above shows the “chosen” users, where the checkbox is ticked below. With the X it’s possible to remove the user again.

For the checkbox I created a custom state (yes/no) called “toggled”. How can I show in the repeating group above only the users with the checkbox ticked? And remove them by clicking X and then set the state to no.

(Same feature as in whatsapp when creating a group)

Thank you for the help!

You could create a list custom state of type: user and make it the data source for the repeating group at the top. When a checkbox is ticked for a user, you would add that user to the custom state and when unchecked, you would remove the user from the state.

Yes that worked, thanks for the help!

I’m just having one issue now, with the checkbox I can selecet and remove users now. With the X on the top I’m able to remove users from the list, but how can I set the state of the checkbox? It’s not available to choose as an element in the workflow “set state”.