- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2025 09:37 AM
I have the below variable in a catalog item called from_division.
This variable is auto- populated
I have another variable of type Yes/No called ABC _Employee. If ABC_Employee is yes, then I want to update the from_division variable to a specific value of "ABC" from the department table. What is the best approach?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 09:15 PM
if you know the department sysId then simply hard-code but don't use GlideRecord
For best practice, story that sysId in system property and use GlideAjax to get that and then set in client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == 'Yes')
g_form.setValue('from_division', 'sysId');
else
g_form.clearValue('from_division');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 06:26 PM
Hello @Anu_Arv ,
First of all it's not good practice to use gliderecord on client side please use script include for that.
Secondly if you want to use use getreference instead of gliderecord to achieve the values.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 09:15 PM
if you know the department sysId then simply hard-code but don't use GlideRecord
For best practice, story that sysId in system property and use GlideAjax to get that and then set in client script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) {
return;
}
if (newValue == 'Yes')
g_form.setValue('from_division', 'sysId');
else
g_form.clearValue('from_division');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2025 07:06 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2025 08:44 AM
Thank you so much. That helped!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2025 08:39 AM
Need Help here! Say the end user selects Yes first and then selects No, the value in the from_division field is cleared out. The field from_division is left blank since it is auto-populated when the employee name is selected. How can I get it to populate the department of the selected employee?