
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 09:54 AM
ver. London
I have a List Collector on a catalog item.
With settings:
- | Type specifications tab |
- List table [ A Table with a few items ]
- | Default Value tab |
- Variable attributes [ no_filter,glide_list ]
I'm trying to do 2 things.
- Using an onChange client script, just push the result out to a g_form.addInfoMessage() so I know it's there.
- Using an IF workflow activity, get the value so I can use it in the conditional
The list collector when activated in Platform or Portal works as expected, but I can't seem to get to the actually values represented therein.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var theValue = g_form.getValue(newValue);
// I get nothing here...
g_form.addInfoMessage("This should be the list collector value " + theValue);
// var lstr = g_form.getValue(newValue).toString();
// var thingsChosen = lstr.split(",");
// for(i=0; i<thingsChosen.length; i++){
// var temp = '';
// var thing = new GlideRecord('u_roll_on_equipment');
// thing.addQuery('sys_id',thingsChosen[i]);
// thing.query();
// if(thing.next()){
// temp = thing.u_equipment;
// }
// I get nothing here when section un-commented
// g_form.addInfoMessage('this is temp ' + temp);
// }
}
In the workflow using the IF activity, where I also get no love...
IF workflow activity
Conditions
condition [Variables][My Catalog Item][List Collector Variable][contains][ Smoothie ]
What's the trick to accessing these values?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 09:59 AM
Hi,
This is for using it in server script, but the same premise should work for client, you'd just need to use g_form instead:
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 09:59 AM
Hi,
This is for using it in server script, but the same premise should work for client, you'd just need to use g_form instead:
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 10:16 AM
So I guess my logic/code was just wrong with the onChange, because this works. Thank you Allen A.
var theValue = g_form.getDisplayValue('The Field').toString(); //newValue.toString();
var list = theValue.split(",");
for (i=0; i<list.length; i++) {
g_form.addInfoMessage("This should be the list collector value " + list[i]);
}
So now, the workflow value? Also, I thought g_form.getDisplayValue was going away?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 10:23 AM
IF statement in workflow....you'd have to use current.variables.name_of_list, etc. in same context as g_form. So you can set a variable to the current.variables.name_of_list, if you want.
var listValue = current.variables.name_of_list.toString()...then split it etc. as referenced above.
And I haven't heard of displayvalue going away...works through Madrid and all that now anyway.
Please mark answer as Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2019 10:37 AM
Allen,
What I did was to find the sys_id and stick it in there. It works now. But I'll try the current.variables.VARNAME too.
Thanks for all your help.