When an attempt is made to load more than 34 values into a List Collector variable in Service Portal using a GlideAjax call from a client script to a script include, the variable will be empty and no values will display.


All supported releases up to and including Madrid Patch 4


Fixed in New York (PRB1327287)


This issue can be resolved by using the following GlideForm setValue method, passing arrays for the second and third parameters:

g_form.setValue('glide-list_field_name', sysIDArray, displayNameArray);

In the script include create an array or a simple comma-separated string for the sysIDs and one for the display values of the values to be used to populate the List Collector. Return a string of the two lists concatenated with a separator between them.

var listValues = [];
var listDisplayValues = [];
var gr = new GlideRecord('sys_user_grmember');
while ( {
  listValues.push(gr.getValue('user')); // sysID of user
  listDisplayValues.push(gr.getDisplayValue('user')); // display value of user
return listValues.toString() + '||' + listDisplayValues.toString();

In the client script's callback function split the return value and pass the resulting lists to the setValue method. **NOTE: the following snippet uses the fictional GetUsers script include. You will need to create your own.

function onLoad() {
var userList = new GlideAjax('GetUsers'); // Your script include userList.addParam('sysparm_name','getUsersByGroup'); // Your script include method userList.getXML(populateUserList);
function populateUserList(response) { var answer = response.responseXML.documentElement.getAttribute('answer'); var userLists = answer.split('||'); g_form.setValue('my_list_collector_var',userLists[0],userLists[1]); }

Additional Information

Article Information

Last Updated:2019-08-02 20:37:31