how to exclude related list action in CSM workspace from specific role

Alon Grod
Tera Expert

Hi,

how to exclude related list action in CSM workspace from specific role, for example 'itil' role:

Screenshot 2026-02-25 115155.png

1 ACCEPTED SOLUTION

@Alon Grod 

admin inherits all role so it will hide as that condition will be false for admin user

try this

!gs.hasRole('elcam_user') || gs.hasRole('admin')

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

View solution in original post

20 REPLIES 20

@Alon Grod 

Better handle this via Table.None CREATE ACL

if your user doesn't satisfy that ACL then NEW button will be hidden

Why to touch the related list action?

if you still want then do this

1) identify the correct Related List action ( if it's on global then override it for your table)

2) in that script condition check !gs.hasRole('itil')

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

@Ankur Bawiskari tried this:

!gs.hasRole('itil')

Not working with the role that im trying to exclude

Hi @Alon Grod 

 

https://www.servicenow.com/community/developer-forum/hide-list-ui-action-in-configurable-workspace/m...

 

https://www.servicenow.com/community/developer-forum/how-to-hide-related-list-actions-from-workspace...

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2691984

https://www.servicenow.com/community/next-experience-articles/introduction-to-declarative-actions/ta...

 

Check here are some screenshot added.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

have a look here @Alon Grod 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Dr Atul G- LNG
Tera Patron

This was suggested by AI — could you please check if it’s valid for you, mate?

 

 

To hide related list UI actions (like 'New' or 'Edit') in ServiceNow Workspace, use Declarative Actions (sys_declarative_action_assignment) to update button visibility based on roles or conditions. For specific lists, configure List Control in the platform view to omit buttons, or in UI Builder, select the related list component to hide the action.
 
Here are the primary methods to hide related list UI actions in Workspace:
  • Update Declarative Actions (Best Practice): Navigate to sys_declarative_action_assignment.list. Find the action (e.g., "New" or "Edit" on your table) and update the Conditions field to restrict visibility based on roles or record states.
  • Action Exclusions (For List Buttons): Search for "Action Exclusions" in the platform navigation. Create a new entry for your table to exclude specific actions (e.g., New button) from appearing in the Workspace.
  • Configure List Control (Omit Buttons): Right-click the related list header in the standard UI, select Configure List Control, and use the "Omit New Button" or "Omit Edit Button" condition script.
  • UI Builder (Page Configuration): Open the record page in UI Builder, select the Related List component, and configure the actions to disable them directly within the workspace layout.
  • ACLs: For security-driven restrictions (e.g., hiding 'New'), create a "Create" ACL on the table to ensure users without access do not see the button.
*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************