Make a field mandatory on the form

Bhavani13
Tera Contributor

Hi, 

We have created few fields with choices Yes, No and N/A in change request form, so whenever the choice N/A is selected the comment fields should be visible and mandatory. can some one help me how to write one UI policy using script on all those fields.

 

Thanks, 

Bhavani.

1 ACCEPTED SOLUTION

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Bhavani13 

In UI Policy conditions tab add the relevant conditions

Add below UI policy action 

VoonaRohila_1-1684157050181.png

 

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

3 REPLIES 3

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Bhavani13 

In UI Policy conditions tab add the relevant conditions

Add below UI policy action 

VoonaRohila_1-1684157050181.png

 

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Shah Jay
Tera Expert

Hi Bhavani, 

May I ask why do you want to use Script on UI policy when it can be achieved without scripting as well? 
You can create your condition something like this. Instead of No select N/A in options. 

ShahJay_0-1684156899760.png

 



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

OlaN
Giga Sage
Giga Sage

Hi,

 

There is a script on the incident table that works similar as your requirement, find it, and make another one using that as a template.

The script on the incident table is called: "Worknotes mandatory onChange of priority"