Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How tTo remove options from field when one doesnt have particular role

RkK455802320017
Giga Contributor
 
3 REPLIES 3

p_kanczugowski
Tera Guru

Hi @RkK455802320017, please elaborate. Are you saying that you'd delete sys_choice records without having the role role that the /delete ACL imposes?

Hi @p_kanczugowski ,

suppose if a person doesnt have the role 'itil', then he/she must have only one option '3-Low ' in impact field. remaining options should not be visibile to that person

 

Jayant_M
Kilo Sage

Hi @RkK455802320017 ,

 

You can use client script with below code

if (g_user.hasRole('role_of_user')){

g_form.removeOption();

}

Please mark my response helpful if it resolves your issue.