How to populate 20 choices in a list collector variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2018 06:03 PM
I have an urgent requirement that I need to populate 20 choices in a list collector variable in a wizard. I cannot create a separate table in Client instance with these 20 choices only to make it as the list table.
I tried setting another muliple choice variable with these choices and use the query as a reference qualifier for the list collector from the Question choice table. But it is displaying the entire set of values from question choice table and not filtering the choiices. Can anyone please guide me with a solution as to how it can be achieved as I am not very good at scripting?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2018 04:06 AM
we faced a similar problem earlier, late realized we had two different reference qualifier. Work on the on where reference qualifier type like simple, advamce and dynamic is present.
uisng advanced ref qualifier.
try: javascript: question=sys_idINSYS_IDoFvARIABLES;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2018 06:19 AM
Shariq, per the title of this thread the question is referring to a list collector variable. These already default to an advanced reference qualifier and the selection is hidden by default.
The advance reference qualifier you said to try does not work as it refers to an object which does not exist.
So far udhay's solution is the only one that works but only for admin/catalog_admin users.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2018 06:56 AM
Because it is not supposed to work like this.
the sys_idINSYS_IDoFvARIABLES isto be interpreted as :
comma seperated sys_id of the choice question. so it should only find for those sys_id those are in the list
to further simplify :
javascript: sys_idIN98d5d9c8dbbf53008b19502bdc961961,1cecead7db2bd7808b19502bdc961947,....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2018 07:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2018 11:05 PM
Hi Muktha,
You can set the max no. of values of the field using 'length' of the field.
ex: var gr = g_form.getValue('watch_list_var_name').split(',');
if(gr.length == 5){
alert('exceeded the length');
return false;
}
Please look into following link for any further clarification.
https://www.servicenowguru.com/scripting/client-scripts-scripting/limiting-selections-list-collector/
Please mark answer correct and helpful based on the response.
Warm Regards
Nikhil Dixit
Engineer
| www.DxSherpa.com |