Have checkbox set based on existence in databse

Hi, I am having my normal trouble of getting dynamics to do what I want.

I have a repeating group in a group focus. On the left I have an ionic checkbox. The repeating group is a list of users (or a searched list), I would like to have the check box check if the user exists in another database. and checking the checkbox would put the user into the second database.

Soooo… to be specific:

I have a DB of users:

and I have a DB of students

I have a search for users which works fine

But that checkbox doesnt work fine. I want the checkbox to be checked if the cells current user is in the student DB, and unchecked if not. If I uncheck a user then the user should be removed from student DB and if IU check the user it should be copied into the student DB.

not sure what should go here, but I expect there is some workflow that needs ot happen.
image

Ok I cant delete this, but with some help I got it working. I beleive this was the key