Populate Record Producer Field with UserId

Shy
Tera Contributor

I am new to ServiceNow. I am attempting to create a drop-down field on a record producer where the user can select an employee's "User ID". However, I am not able to find the field under the "[User] sys_user" table. Does anyone know where or how I can get this field to populate? I am not familiar with scripting within the platform either. I appreciate any help. Thanks!

2 ACCEPTED SOLUTIONS

Sandeep Rajput
Tera Patron
Tera Patron

@Shy There is a field User ID (user_name) defined on the sys_user table which can be used for showing the select box variable with user id fields.

 

Screenshot 2023-05-30 at 10.43.26 PM.pngScreenshot 2023-05-30 at 10.42.26 PM.png

View solution in original post

This is how you should configure your lookup select box.

Screenshot 2023-05-30 at 10.58.55 PM.png

Screenshot 2023-05-30 at 10.58.24 PM.png

View solution in original post

7 REPLIES 7

Thank you Sandeep!

 

Do you know how I can limit it to only pull active employees in the Lookup Box Selector?  

@Shy write active=true in the reference qualifier in Type Specification of your lookup select box as follows.

Screenshot 2023-05-31 at 9.11.31 AM.png

ronprice
Giga Guru

The field that you're looking for is called user_name on the sys_user table.  With regards to your requirement though, is is it the expectation that the actual User ID will populate into some field on the produced record?  The reason for the question is that if you are simply using a variable with a reference to the User table, by default the system is going to show the Display Value for the table, which is the name field (first + last), not the user_name.