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 to show only options based on roles or groups?

Rain Vaine
Kilo Sage

Hello experts,

If I want to only display a select options to certain or role or group, what do we use?

RainVaine_0-1683866885920.png

 

In this sample I would only one to display in progress, on hold and resolve to one group only,

Can UI policy handle this?

regards,

Vaine

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@Rain Vaine 

you can use onLoad client script if you know the role for which you want to show options

something like this

function onLoad(){
	if(!g_user.hasRoleExactly('Role Name')){
		// user doesn't have this role so remove the options
		g_form.removeOptions('state','choiceValue');
	}
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks,

I will try your suggestions