- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-23-2025 10:30 PM
I want the UI actions displayed in the cell context menu to be visible only to admins.
I set the "Requires role" for the UI action to admin, but it was not hidden.
Is this not possible to use this on the list screen?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 08:04 PM
then don't touch the OOTB UI action
Ensure you override that for your custom table
1) open the OOTB one
2) change the table to your custom table
3) add this in condition
current.canWrite() && gs.hasRole('admin')
4) Right click form header and "Insert and Stay"
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 10:36 PM
Hey @bonsai , You can try the method suggested by @Ankur Bawiskar .
When I was trying to recreate this in my PDI, I used the 'UI Action Visibility' option from the related lists. I added 'Admin View' to the list, and that helped hide the UI Action to other non-admin users. You might want to try that too, if it works for what you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 12:30 AM
Actually, I had already tried this, but it didn't work.
The product documentation said that "current" cannot be used on the list screen.
Could this be the cause of the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 03:40 AM
On which table you are checking this?
May be that table which is task extended has created it's own "Assign to me" List Context Menu button and you need to add gs.hasRole('admin') in that
list context menu can access current object
that OOTB UI action does set assigned_to using current object
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 03:43 PM
Testing with a custom table that extends the task!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 08:04 PM
then don't touch the OOTB UI action
Ensure you override that for your custom table
1) open the OOTB one
2) change the table to your custom table
3) add this in condition
current.canWrite() && gs.hasRole('admin')
4) Right click form header and "Insert and Stay"
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-24-2025 02:55 AM
Hi @bonsai , which task are you trying to test with? - incident, problem, - like that?