Getting selected values in a list collector catalog variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2016 11:25 AM
One of the variables in my catalog item is a list collector. This list collector permits users to select records (move from left to right) to be de-activated. Upon submit (I will use a On Submit client script), I want to loop through the selected value(s) in the list (right-side of the list); then I will find the appropriate record in the table and set Active = false. I know how to update the record (GlideRecord), and how to code a loop, but I am not certain how I get the Selected values into an arry. Thanks!
Ric

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2017 06:20 AM
Hi Rakesh,
One suggestion - ensure the variable is a string with toString();
var group_member = current.variables.XLIT_queueMembersList.toString();
Also, where is group_sysid set? I don't see it here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2017 03:22 AM
Hi Chuck,
Thanks a lot it worked.
I have not provided the entire code, group_sysid had the sys_id of new group which is getting created.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2017 06:09 AM
I'm glad it worked.
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2018 01:12 PM
Hi Chuck,
hoping you can help with what I'm trying to do...I've got a list collector type field on a catalog item, and I have a GlideAjax set up to return the groups of a certain type that the user (as determined by a reference field on the form) is NOT in. I want only these options to visible for selecting in the list collector type field. Thanks in advance Chuck!
Here's my catalog client script:
function onChange(control, oldValue, newValue, isLoading) {
if (newValue == '' || newValue == 'remove_groups') {
return;
}
g_form.setVisible('u_list_groups',true);
var user = g_form.getValue('u_req_for');
var ga = new GlideAjax('ajaxGetUsersGroups');
ga.addParam('sysparm_name','returnGroupsUserIsNotIn');
ga.addParam('sysparm_userid',user);
ga.getXML(setGroups);
//receive the array from the script include
function setGroups(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
var arr = answer.split('||');
if (window === null)
//alert('arr is '+arr);//commented out, but I know it is correct by screen shot below
what can I put here so that the choices for the field 'u_list_groups' are only what is returned in "arr"?
}
}
And I know my array is coming back correct because of my alert message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2019 02:47 AM
Hi Chuck,
I have tried to get value of List collecter variable by using your script. and It is not work.
Do we have to try this in Onchange client script?