Make field mandatory and display an error message if not filled

GUSNOW13
Tera Contributor

Hi, I have a field called 'Request classification' on the form which should be made Mandatory. It has two options 1)Prod 2) Non prod either one of those has to be selected and by default column will have none option. If form saved without filling either of the two options it should display an error message as 'Mandatory fields are not filled' and also should n't allow the user to save the record without selecting one option. How to achieve this..

1 ACCEPTED SOLUTION

Hello,

 

If you make a field mandatory using UI policy it will not allow the user to submit form without one of the option being selected.

 

Also on portal it will show an error message as below:-

 

Saurav11_0-1669966706203.png

 

On Native UI it will show an error message as below:-

 

Saurav11_1-1669966735849.png

 

Please mark my answer as correct based on Impact

View solution in original post

7 REPLIES 7

Thanks  but another requirement is ….If form saved without filling either of the two options it should display an error message as 'Mandatory fields are not filled' and also should not allow the user to save the record without selecting one option. How to apply this

@GUSNOW13 If you mark the field as mandatory then servicenow will take care of it. See image below where Caller and 'Short Description' of incident fields are mandatory. I tried to submit them without filling. System shows the error on top and will not allow to save.

 

jaheerhattiwale_0-1669966849682.png

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

Voona Rohila
Mega Patron
Mega Patron

Hi @GUSNOW13 

Can you share screenshot of the choices? Did you add None as choice?

Make sure you are using 'Dropdown with None' for the Request classification' field.

RohilaVoona1_1-1669966982888.png

 

Right click on the field label on the form and click on 'Configure dictionary' and make the field mandatory by checking the mandatory checkbox - This will make the field mandatory and will throw a error message if not filled.

Example  :

RohilaVoona1_0-1669966837140.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