Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

What is the difference between sys_user.role field and sys_user_has_role related table?

felipe_barbosa
ServiceNow Employee
ServiceNow Employee

The title pretty much tells all:

What is the difference between sys_user.role field and sys_user_has_role related table?

In the user form there is a field called Roles (sys_user.role) and also a related list for Roles (sys_user_has_role), and the information on both doesn ´t match (in our case, the roles are set in the Roles related list instead of the Roles field.

Does anyone knows the difference between these two?

Thanks and regards,


Felipe

1 ACCEPTED SOLUTION

CapaJC
ServiceNow Employee
ServiceNow Employee

sys_user.roles is a glide_list field that used to store a user's roles before Contextual Security. With Contextual Security, the related list is used instead, and roles field is not used.

I do not know why the field is still shipped with new instances. It can be safely deactivated in the Dictionary so it won't show up as a candidate to be added to lists/forms.


View solution in original post

2 REPLIES 2

CapaJC
ServiceNow Employee
ServiceNow Employee

sys_user.roles is a glide_list field that used to store a user's roles before Contextual Security. With Contextual Security, the related list is used instead, and roles field is not used.

I do not know why the field is still shipped with new instances. It can be safely deactivated in the Dictionary so it won't show up as a candidate to be added to lists/forms.


felipe_barbosa
ServiceNow Employee
ServiceNow Employee

CapaJC, thanks much for this, I've made some tests and realized that the field Roles in the user tables doesn't change anything for accessess, but I am happy that you have clarified this.

Cheers!

Felipe