UI Policy is not working?

Sid_Takali
Kilo Patron
Kilo Patron

Hi all,

I have created an UI Policy to make a field visible based on reference field condition. When a reference field has certain value then a field should be visible. This is working when I save a form but I need this should work on reference field value change. 

Ex. Fields B and C should be Visible only when I select Reference Field Value as a A. This is working only when I save the form but I need this onChange of reference value.

10 REPLIES 10

Lutuf Ali Shah1
Tera Expert

Hey @Sid_Takali,

UI Policy does have Onchange behavior based on your condition, if your condition matches while you change the field value of A even if it's a reference field, fields B and C will be visible accordingly.

If you've specific values for the reference field, set condition on UI Policy as, ( A | is | value).

If you've not any pre-defined value to be matched on the condition, then set the condition as ( A | is not empty).

Also, make sure the "Reverse if false" checkbox is checked so you can see the changes.

I think your policy is working only on "OnLoad" only as you are seeing changes after saving the form.

 

- I've created a policy based on the subject person field and set assigned to field visibility.

screencapture-dev123001-service-now-sys-ui-policy-do-2023-01-30-13_05_18.png

So As long as the subject person field has other than Abel Tuter user selected, the "Assigned to" field remains hidden, If change the user is to Abel Tuter, the "assigned to" field will be visible and set to mandatory without saving the form.

LutufAliShah1_0-1675066396330.png

Once I've selected Abel as a user UI Policy condition is matched and the Assigned To field is visible and set to mandatory even though I've not saved the changes.

LutufAliShah1_1-1675066860358.png