- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:47 AM
Hi everyone,
I have one catalog client script that works perfectly:
function onChange(control, oldValue, newValue, isLoading) {
var caller= g_form.getReference('Employee');
var gr = new GlideRecord('cmn_department');
gr.get(caller.department);
g_form.setValue('EmployeeOUC',gr.id);
}
I use this to grab the department of an employee.
Now I also want to grab the EmployeeID of the employee, but I'm not sure of the exact field name and I can't figure out how to look that up.
How do I view the field names in the sys_user table (which is where I assume the employee ID will be stored?)
Thanks for any help you can offer!
Scott
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:52 AM
The employee ID?
That would have to be data brought over from somewhere? Like an AD account or something?
Either way, to view the field names you go to the Tables and then look for sys_user and all the fields will come up there.
I do see one that says Employee Number aka employee_number
perhaps that's what you're referring to.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:49 AM
Go to the user record and right click the top bar and select Show XML, this will show you all fields on the User form.
It's usually stored in the user_name variable, but that could be different from company to company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:58 AM
I'm sure this is a stupid question, but it's been months since I've been in Servicenow and I can't remember how to even pull up a user record. Where do I start?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 08:05 AM
write User in the filter navigator and you should have it under User Administration.
Or you can simply write sys_user.list to list all users and then enter one of them and bring up the XML from the form when it has loaded

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2018 07:52 AM
The employee ID?
That would have to be data brought over from somewhere? Like an AD account or something?
Either way, to view the field names you go to the Tables and then look for sys_user and all the fields will come up there.
I do see one that says Employee Number aka employee_number
perhaps that's what you're referring to.
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!