How to populate 20 choices in a list collector variable?

muktha1
Tera Guru

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

9 REPLIES 9

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;

 

KamalM
ServiceNow Employee
ServiceNow Employee

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.

find_real_file.png

 

So far udhay's solution is the only one that works but only for admin/catalog_admin users.

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,....

KamalM
ServiceNow Employee
ServiceNow Employee

so what you are suggesting is the same as udhay's solution but using javascript instead of encoded query.

It will still not work for end users (no role).

Nikhil Dixit
Giga Expert

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

t

| www.DxSherpa.com |