Suzanne Smith
ServiceNow Employee
ServiceNow Employee

Are you already using UI actions? Many ServiceNow customers use them in a variety of creative ways. If you are using UI actions in your instance, consider refining them and controlling when they appear and for whom. For example, you can show the Delete button on the Problem form only to users with the admin role instead of all users.

 

For those who are not using them yet, a brief definition. UI actions are elements such as buttons, links, or a context menu that you can add to a form or list. When a user clicks the element, some script is executed. UI actions help customize the user interface and make it more specific for individual users. Users with the admin or ui_action_admin role can create UI actions.

 

ui_actions1.jpg

 

 

How to limit access with conditions:

Many users limit a UI action by defining a condition. If the condition is true, the action is visible. (Note that leaving the field empty defaults the condition to true.)

 

Here is an example for the Delete button on a Problem record:

ui_actions2.jpg

In this UI action, the Delete button only appears on the Problem record if the problem is in Closed/Resolved state.

 

 

How to limit access with roles:

Combine conditions and roles to limit access to UI actions by user role. The syntax is: gs.hasRole('role_name').Here is an example again for the Delete button on the Problem record, but this time we are controlling access by role:

ui_actions3.jpg

In this UI action, the Delete button only appears on the Problem record if the user has the admin or problem_admin role.

 

 

How to limit access with views:

Another nifty way to control who sees a UI action is by including or excluding views using the UI Action Visibility related list. Note that if you do not include or exclude views, the action appears on all views. In this example, we are specifying that the Close Incident UI Action is only included (visible) in Advanced view:

ui_actions4.jpg

 

There are some great discussions the community about UI action visibility:

 

ServiceNow offers more information about UI actions in the product documentation:

11 Comments