How to make label field mandatory for a catalog form.

User205031
Tera Contributor

Hi,

We have a requirement to create the Label Variable and  there are multiple checkboxes under it.


The requirement is to make the label as mandatory instead of each checkbox. If any of the checkbox is checked, the label will become non-mandatory.

 

Below is the label and checkbox fields:

User205031_0-1742893228143.png

 

I have created UI Policy to make 1st checkbox as mandatory

User205031_1-1742893302468.png

 

When I am trying to select other checkbox in the form, the label is still mandatory:

User205031_2-1742893371167.png

It is not working.

Please help with your suggestions.

Thanks!

9 REPLIES 9

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @User205031 

 

Why do you want to make the label mandatory? Labels don’t hold any value, and users can simply skip them.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron
Tera Patron

@User205031 

Labels cannot be made mandatory as they are not input field

check this link for workaround

How to make label field mandatory-catalog form. 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar ,

 

I followed the same approach, but its not working

@User205031 

it has worked as per the link I shared above.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Suthan S
Tera Expert

Hi @User205031 , 

 

I think catalog client script works in this case, But I'm not sure whether we can make the label mandatory.

 

You can use an On Load Catalog Client Script. You have 2 variables(two check boxes), capture the response of these check boxes in an array and check if any one value is true using a for loop. If any one of the response is true try to make the label mandatory.

 

Hope this help, If yes please mark it correct.

 

Thanks.