How can I see the list of fields stored in sys_user?

scottn
Mega Expert

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

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

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!

View solution in original post

5 REPLIES 5

palmen
Tera Guru

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


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?


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


Allen Andreas
Administrator
Administrator

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!