How to make field visible by using client script

sasi
Tera Contributor

In change request there is field 'Risk', this Risk field is choice list.once choice is 'high' selected from Risk field i want 'access' field in the change task should visible. i can do this by using UI policy. but to do by using client script. for my requirement i need to use client script. 

2 REPLIES 2

Prateek kumar
Mega Sage

https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_GlideFormSetVisible_String_Boolean


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

DScroggins
Kilo Sage

Hello,

 

Create an onChange Client Script on the Risk field then add following logic:

if(newValue == 'high'){

g_form.setDisplay('Access','true');

}else{

g_form.setDisplay('Access','false');

}