User Fields are not auto populating while creating catalog form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
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! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
27m ago
Hi @aravind1patil1 ,
- Create a variable:
- Requested For (Reference →
sys_user)
- Requested For (Reference →
- Create variables for:
- Department
- Position Title
- In each variable, use Autopopluate with dot-walking:
- Department →
requested_for.department - Position Title →
requested_for.title - Email →
requested_for.email
- Department →
Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.
Regards,
Vaishnavi
Technical Consultant
