We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Empty field show error message and unable to submit request

Not applicable

Hi Team one requirement in my project 

 

there is one field in record producer  name as " Representative "(String type field) which is populate on another field "username *(reference type field )

If "Representative" value is empty, on submitting the form show the error message "Request cannot be submitted due to Representative value is empty"

 

anyone help me how to achieve this functionality ?

 

4 REPLIES 4

Dr Atul G- LNG
Tera Patron

Hi @Community Alums 

 

It is more on data issue, also try with UI policy or try with catalog client script something like

 

rep.getvalue== ""

show error message. In UI Policy we can do this easily with message type like Info/ error / warning.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Not applicable

hi @Dr Atul G- LNG  how to restrict for submitting the  request if the value is empty user do not submit request

Hi @Community Alums 

 

You can make it mandatory and also in pop up( error type) , user had to put the value.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Jitendra Diwak1
Kilo Sage

Hi @Community Alums,

 

Write the onSubmit client script and validate your condition like
var representative= backendnameofvaraible;
if (representative == ''){// g

    return false;

}

 

Please accept my resolution if it works for you and thumps up.

 

Thanks

Jitendra

Please accept my solution if it works for and thumps up.