The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Cant hide a field with catalog ui policy?

Jared Wason
Tera Guru

Hello,

I have a form with a string field 'Printer Name' that is mandatory by default, but I have setup a catalog UI policy where if a checkbox is selected the 'Printer Name' field should no longer be mandatory and become hidden. However it does not hide the field, if I turn off the mandatory setting on the 'Printer Name' field then the catalog UI policy works properly, but I need 'Printer Name' to be required. Can anyone see what I am missing here? 

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

On your UI Policy, please select "reverse is false" checkbox and see if that helps.

With the field having the mandatory checkbox set within it's dictionary, the UI Policy and/or Client Script should, in theory and my past experience, override the dictionary, as you also thought, but perhaps with the reverse if false not checked, it's not having it engage and in those moments when the UI Policy results true, it's not overriding, for some reason.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

3 REPLIES 3

Allen Andreas
Administrator
Administrator

Hi,

On your UI Policy, please select "reverse is false" checkbox and see if that helps.

With the field having the mandatory checkbox set within it's dictionary, the UI Policy and/or Client Script should, in theory and my past experience, override the dictionary, as you also thought, but perhaps with the reverse if false not checked, it's not having it engage and in those moments when the UI Policy results true, it's not overriding, for some reason.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thanks this did it. This and being in the proper domain (I was initially in global) fixed the issue. 

Mark Roethof
Tera Patron
Tera Patron

Hi there,

On your second image, it's shown that the variable is mandatory. This is in the way. Make your variable conditionally mandatory using a UI Policy instead of having the mandatory=true set on the variable itself, than the conditionally visible will also work.

If my answer helped you in any way, please then mark it as helpful.

Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP

---

LinkedIn
Community article, blog, video list

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn