Need to hide checkbox section based on condition

suuriya
Tera Contributor

Hi 

 

I have created a mandatory check box section with label (created one label field and 4 check box field made this section has mandatory using ui policy by keeping "and" condition of all option's is not true and ui action as one of the option is mandatory) now this section is multi select mandatory field.

 

Now i need to hide the entire section (boxes + label) based on another condition

Example field - It is required? options yes no if no is select then this entire section should be visible if it is yes entire section should not be visible

 

Tried ui policies but it is not hiding the entire section only 1 0r 2 check boxes are hidden 

How it can be achievable 

 

Thanks,

Suuriya

4 REPLIES 4

Sagar Pagar
Tera Patron

Hi,

You have to make all check-boxes and label fields as non-mandatory and then you have to hide the sections and fields.

 

Thanks,
Sagar Pagar

The world works with ServiceNow

Hi Sagar,

 

but I need the check box to be multi select mandatory field

Gunjan Kiratkar
Kilo Patron
Kilo Patron

Hi @suuriya 

In order to hide section use client script and on Change of box use below line of code.

 

g_form.setSectionDisplay('closure_informtaion', false); //Writedown your section name

 


Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy

Hi Kiratkar,

 

I tried it is not working it is throwing script error in portal