Filter User Roles to assign UserID as a attribute to an entity

I want to assign a user to each record in an entity (called Games), but need to filter the IDs only for one role. How can I do it, so that when the Games entity record is being created, the combobox to add use only shows User Ids from users that belong to the role "GameAdmin".

I have tried to create a structure with GameAdmins, but couldn't find the user roles to use in the SQL statement.

You can use the (System) entity User_Effective_Role to achieve that. For instance, you can have an Aggregate querying your users and have a Only With join with the User_Effective_Role entity (e.g. User.Id = User_Effective_Role.User_Id) with a filter over the GameAdmin role (e.g. User_Effective_Role.Role_Id = Roles.GameAdmin).

Alternatively, you can filter the query results in memory by using the CheckGameAdminRole function. If happen to be using version 10, you can use the ListFilter action under (System) to achieve this easily.

If your module doesn't have it already, you need to add a reference to it by going to Manage Dependencies (main toolbar, or under the Module menu) and finding the User_Effective_Role entity in the (System) references.