Hide Checkbox list from the catalog task

shraddhajay
Tera Contributor

How to achieve, In SC Task (Catalog Task), hide the checkbox list and show only the options that were selected by the requester.

2 REPLIES 2

Riteshv32564711
Tera Contributor

Hi Shraddhajay,

you can  use Catalog UI Policy ;-

var values = g_form.getValue('your_checkbox_variable');
var allChoices = g_form.getControl('your_checkbox_variable').options;

for (var i = 0; i < allChoices.length; i++) {
if (!values.includes(allChoices[i].value)) {
g_form.removeOption('your_checkbox_variable', allChoices[i].value);
}
}

Tanushree Maiti
Kilo Patron

Using Catalog UI policy you can achieve it.

 

e.g You have two check box variable e.g check_A , check_B

 

Then per checkbox , create a catalog ui policy.

 

1) Catalog UI policy 1

Short description  :Hide empty Check_A box

When to Apply : Check_A | is| false

Applied on Catalog Task : True

UI Policy ACtion :

    Check_A          Display =False

 

1) Catalog UI policy 2

Short description  :Hide empty Check_B box

When to Apply : Check_B | is| false

Applied on Catalog Task : True

UI Policy ACtion :

    Check_B         Display =False

 

 

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin: