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

Sagar Pagar
Tera Patron

Hi @Sid_Takali,

Can you share your UI policy conditions here?

 

Have you added condition as  -

Reference field IS NOT EMPTY

 

then visible - true

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Hi @Sagar Pagar 

When The condition is "Claim Type is A"  then fields B and C Visible. This is working fine on a form save but I need this on change of Claim Type(reference field). 

shivangi k
Kilo Sage

Hi @Sid_Takali 

 

You can achieve this by applying onChange client script, please refer below script:

if(g_form.getValue('refernce filed name')=='A')

{

g_form.setVisible("B",true);

g_form.setVisible("C",true);

}

else{

g_form.setVisible("B",false);

g_form.setVisible("C",false);

}

 

Please mark helpful, if it helped you.

 

Regards,

SoniaShridhar13
Giga Guru

@Sid_Takali  Can you share screenshots so that will figure out what exactly is the issue and the conditions you need to put to achieve this.