Getting sys_user information from sys_user_grmember

Patrick Maxwell
Mega Expert

I have a reference to the 'sys_user_grmember' table inside of a catalog item which only allows selections from members in a certain group. When a user is selected I need to get that user's name and phone number but can't figure out how to do that since the phone number is not stored in this table. I also don't think the user's SID is in this table so can't query the sys_user table using that. Does anyone have a way to do this?

1 ACCEPTED SOLUTION

Hi,
Phone number is present on the user table. You can reach user from sys_user_grmrmber, further you can dot walk to user table to get the contact detail.

Like below screenshot-

SaurabhGupta_0-1702928757649.png

 





Thanks and Regards,

Saurabh Gupta

View solution in original post

9 REPLIES 9

Hi,
@Patrick Maxwell you can easily do the do walking there.

SaurabhGupta_0-1702928410957.png

 


Thanks and Regards,

Saurabh Gupta

That would auto populate the user's name but would leave out the phone number since that is not stored in that table, right? Is there a way to get the sys_id from that table?

Hi,
Phone number is present on the user table. You can reach user from sys_user_grmrmber, further you can dot walk to user table to get the contact detail.

Like below screenshot-

SaurabhGupta_0-1702928757649.png

 





Thanks and Regards,

Saurabh Gupta

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Patrick Maxwell 

 

You can use Auto Populate , in catalog item.

 

this is possible via Auto Populate. 

 

LearnNGrowAtul_0-1702927199286.png

 

 

Actually there's not much more to write on this, the Auto-populate functionality is just so straightforward! Have a Variable of type reference on your Catalog Item, create a new Variable that you want to Auto-populate and fill in the three fields under the new Auto-populate section, and that's it.

 

https://www.servicenow.com/community/developer-articles/auto-populate-reference-data-in-service-cata...

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

I don't think that would work for me because I'm trying to get information that is not stored in the table I'm referencing. Is there a way to get the sys_id of the user in the sys_user table from the sys_id of the user in the sys_user_grmember table? If there is a way to do that then I guess I can just query using the sys_id and get it done like that.