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.

Hide choice values based on roles

harry24
Tera Contributor

What is best practice to hide choice values based on roles in form and list view?

2 REPLIES 2

Aman Kumar S
Kilo Patron

You can use g_user.hasRole() and removeOption() function.

You can follow below post for basic understanding:

Choice list to show depending upon Roles

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

Best Regards
Aman Kumar

Pratima Kalamka
Kilo Sage

Hello Harry,

You can use onload client script in that use g_user.hasRole().

You can refere below link for this:

https://community.servicenow.com/community?id=community_question&sys_id=7a2cc365db9cdbc01dcaf3231f96...

https://community.servicenow.com/community?id=community_question&sys_id=51fc4369db9cdbc01dcaf3231f96...

 

If my answer is helpful  please mark it as helpful or correct!

Pratimak