List Collector's right slush bucket is not populating with onLoad Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 03:14 PM
Using an onLoad client script, I want to auto-populate the right slush bucket of a List Collector type variable with a value from left slush bucket on a catalog form. A solution was provided and accepted in the post below. I am using g_form.setValue('list name', sys_id) as suggested...but t does not work for me. Any idea what could be wrong?
function onLoad() {
var employee_name = g_form.getValue('form_variable_name referencing sys_user');
if (employee_name != ""){
g_form.setValue('list_name referencing sys_user', employee_name);
}
BTW, the employee does exist in the left slush bucket.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 01:10 PM
Hi Paul,
Am just curious about the method 'getDisplayBox' you have mentioned. I don't see that anywhere in the documents. Where did you find it? We might need to get the display value in client scripts for other catalog item reference variables. It will come handy.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2020 05:18 PM
It is an undocumented function.
You can see all g_form functions just by typing g_form into your browser console. Use with caution!
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 11:56 AM
Did you mean that by typing g_form into the browser console even the undocumented methods would get displayed? I tried it but the list of method did not contain the getDisplayBox either in our instance or in OOTB instance (Orlando).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 05:18 PM
I can see it on my instance. You have to ensure that the gfst_main form frame is selected, and that you have a form open.
Alternatively, just view the JS file
https://your-instance.service-now.com/scripts/doctype/GlideForm14.js
As always, use undocumented functions with caution.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2020 08:29 AM
Thanks! Worked after selecting gfst_main form frame by using a cd("#gsft_main"); command in Firefox (https://hi.service-now.com/kb_view.do?sysparm_article=KB0695239). Firefox is deprecating the use of cd. Don't know what it has been replaced with. I use Chrome and the first step described for Chrome in the KB article was:
1. Click the View menu at the top of the Chrome menu.
Chrome no longer has that menu toolbar. It can only be added through as extension which are restricted by our company.
Also,
https://your-instance.service-now.com/scripts/doctype/GlideForm14.js
has several g_form methods but not getDisplayBox method associated with g_form. It is associated with "this".
var displayWidget = this.getDisplayBox(field);
Anyway learnt a few new things.
Thanks!