Getting selected values in a list collector catalog variable

rhofing
Tera Contributor

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

19 REPLIES 19

I don`t see the correct answer link, but Dan Bruhn has already contacted me about this and he is looking into.



Ric


+ dan.bruhn



Thanks Ric for the update.


All,



Please continue @mentioning me on these however there will be a delay in me marking answers as correct.   As we continue troubleshooting the issue our technical team has asked we leave them in the current state.   Once they evaluate the threads I'll come back and mark answers as correct.



Thanks,


Thanks Dan for the update.


Hi Chuck,



I have used code but somehow it is not working , I am getting he sys_id in the string field separated by comma,



but when I getting the length it is showing as undefined.



Can you please check the issue, I have tried but couldn't figure out the issue.



var group_member = current.variables.XLIT_queueMembersList; // this is giving me correct data


var gr_member = group_member.split(',');


var gr_mem = new GlideRecord('sys_user_group');


for(var i=0;i<gr_member.length;i++){


gs.log("creating group member "+gr_member[i]+"the group is" +group_sysid);


gr_mem.initialize();


gr_mem.group = group_sysid;


gr_mem.user = gr_member[i];


gr_mem.insert();



}