How to make "custom with label" variable to be hidden ,mandatory and visible.

SK36
Tera Contributor

I found the following options of (mandatory, hidden, visible) for the data type "custom with label" are not available on catalog item. How to enable those for the data type "custom with label" on catalog item.

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot make it mandatory as it's not some direct variable. the logic to make it mandatory needs to be present within the UI macro or widget you are using to show the content

You can show/hide it like this

1) just create a new variable of type container start just before this variable and container end just after this variable

2) then hide the container start using UI policy etc

Regards
Ankur

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

View solution in original post

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot make it mandatory as it's not some direct variable. the logic to make it mandatory needs to be present within the UI macro or widget you are using to show the content

You can show/hide it like this

1) just create a new variable of type container start just before this variable and container end just after this variable

2) then hide the container start using UI policy etc

Regards
Ankur

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

What Code needs to be added on the widget? so I can make those fields hidden or visible. Because that's is dependent field. 

you will have to write the HTML logic there

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