List Collector Restriction

nikhitha24
Tera Guru

Hi,

 

Can someone please help me on the below script.

nikhitha24_0-1706429166931.png

Based on the what type of restoration do you need i need to restrict the select the server names variable(The type of the variable is List collector).

EX: If the option is Full VM i can only select 5 servers in the selection

       If the option is Files(s) i can select only 1 server in the selection

       If the option is NDMP i can select only 2 server in the selection

 

Please help me on the script

 

 

2 REPLIES 2

Vishal Birajdar
Giga Sage

Hello @nikhitha24 

 

You can use advanced reference qualifier on select server names varible

 

Assuming you have 'restoration' fields (or mag be with different name) available on table which is referenced by 'select server names' variable.

 

write below code in reference qualifier option on variable:

 

 

javascript&colon; 'restoration=' + current.variables.<backend name of what type of restoration do you need>;

 

Please see the below pic as colon (:) symbol after javascript above will get converted to '&colon' due to editor here

 

IMG_20240128_135036.jpg

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Danish Bhairag2
Tera Sage
Tera Sage

Hi @nikhitha24 ,

 

If there is relationship present between the option on catalog item n servers then u can proceed ahead with what Vishal has suggested. 

If not then I think the best option for this requirement would be to use a select box n populate that field using g_form.addOption();

 

As the number of servers u mentioned in ur question are very few, select box field type will be a better suit I feel.

 

Thanks,

Danish