User Fields are not auto populating while creating catalog form

aravind1patil1
Giga Contributor

Dear ServiceNow Community friends, please help if you can

 

I had below issue, if you can check and provide the solution. It is really great help & appreciate your response

 

I am creating a catalog form & below is the requirement

While filling the catalog item form, these fields should be auto populate from the user table

1. Department

2. Position Title

3. Email

 

Where as it reflects: Department ID, with its 'sys_id', but not with its value. I have attached the screenshot (Issue.jpeg) for your reference, please check. Position Title & Email id is not reflecting too

 

I have also used client script. Attached two screenshots, (Script1.jpeg & Script2.jpeg) please check. Seems there is some conflict with these two scripts. When I activate each one separately, its sys_id is reflecting, when activated both its not working at all.

 

Your help is highly appreciated

 

Thanks

3 REPLIES 3

Ankur Bawiskar
Tera Patron

@aravind1patil1 

do you want to set the values with logged in user?

if yes then directly add this in default value of those variables

Department variable

javascript: var dept;
var gr = new GlideRecord("sys_user");
gr.addQuery("sys_id", gs.getUserID());
gr.query();
if (gr.next()) {
   dept = gr.department.getDisplayValue();
}
dept;

Do something similar for other variables

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

abbasshaik4
Tera Sage

Hello @aravind1patil1,

 

Step 1: Create a script include, and it must be client-callable.

Step-2: Create an on-change client script.

 

If it is helpful, please mark it as helpful and accept the correct solution by referring to this solution in the future, it will be helpful to them.

 

Thanks & Regards,

Abbas Shaik

VaishnaviK3009
Kilo Sage

Hi @aravind1patil1 ,

  1. Create a variable:
    • Requested For (Reference → sys_user)
  2. Create variables for:
    • Department
    • Position Title
    • Email
  3. In each variable, use Autopopluate with dot-walking:
    • Departmentrequested_for.department
    • Position Titlerequested_for.title
    • Emailrequested_for.email

Screenshot 2026-04-09 100022.png

 

Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.

Regards,
Vaishnavi
Technical Consultant