why default value not set to the variable if it display using ui policy?

Ramu6
Tera Contributor

Hi All,

Actually we have two text fields that Validation Regex set as " Currency" and default value set as "AUD$", one field is displayed based on other field, for that i have written ui policy, for this field the default value not shown on the form , same as for other field , its shows default value""AUD$",?

 

Please help me on this 

 

The currency field which was display based on ui policy;

 

Ramu6_0-1699860050855.png

 

Another normal currency field;

Ramu6_1-1699860171366.png

Thanks

Ramu

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi @Ramu6,

 

Ensure that the 'Clear the field value' checkbox is unchecked within the UI policy action.

 

OR

Once you make it visible using UI policy, in scripts write this -

 

Execute if true:

g_form.setValue('field_name', 'AUD$'); 

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow

View solution in original post

1 REPLY 1

Sagar Pagar
Tera Patron

Hi @Ramu6,

 

Ensure that the 'Clear the field value' checkbox is unchecked within the UI policy action.

 

OR

Once you make it visible using UI policy, in scripts write this -

 

Execute if true:

g_form.setValue('field_name', 'AUD$'); 

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

The world works with ServiceNow