0
function onLoad() {  
    //Type appropriate comment here, and begin script below  
    var view = getView();  
  if (view == 'sp'){   //self service view name is ess so make to ess
  g_form.setValue('state','2');  
  }  
}
How to check view name using client script in ServiceNow?
Expert Asked question July 18, 2023