How to JOIN sys_user & sys_user_grmember tables

stevezadroga
Tera Contributor

I am working with ServiceNow data with a third party reporting tool and trying to JOIN the sys_user & sys_user_grmember tables.  I want to return the group name, member name, member email, etc.  I was thinking of using the [name] field, but that is not unique.  Are there other keys I should be using?

1 ACCEPTED SOLUTION

user field on the sys_user_grmember table is a reference field to sys_user table. It will return sys_id in the result.


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

View solution in original post

5 REPLIES 5

Prateek kumar
Mega Sage

Try this using a database view??

find_real_file.png


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

I cant see the WHERE clause working because the grmem.user field represents an actual full name of a person AND the usr.sys_id field is an alphanumeric string.  They will not be equal to each other, no?

user field on the sys_user_grmember table is a reference field to sys_user table. It will return sys_id in the result.


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

DirkRedeker
Mega Sage
Hi How does the 3rd party reporting tool access to ServiceNow? Are you using the table API, or do you go by scripted REST API, etc.? BR Dirk