Dynamically create a select box based on user roles / groups
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2026 06:48 AM - edited 03-10-2026 08:55 AM
Hello everyone,
today I got an interesting question. A customer wants to have a dropdown where a user can only select items based on the user's groups or roles. I had the idea of writing the options into a table with a list field that holds the applicable user groups. Then I would potentially use a client script to check the items before displaying them in the select box.
For further clarification, we are talking about 60+ options, each tied to one or more groups or roles. Also the customer wants to exit the roles applicable via a request in the future.
It's just an idea. Has anyone done something like that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2026 07:06 AM
you list down the choices in Select box and then use onLoad client script to hide the options based on logged in user role or group membership
you can use g_form.removeOption(), g_form.addOption() methods
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2026 07:58 PM
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2026 03:14 AM
Thanks for the idea. I updated the question with additional information. Would the removeOption() still be performant with like 60+ options?
