Understanding of UI Action & Declarative Action in Workspace

abirakundu23
Mega Sage

Hi ServiceNow Folks,

I want to mention how UI action & Declarative action are working in ServiceNow Workspace. How can we hide Ui action if its declarative action? In here I tried to put 2 use cases as my experience.

 

UI Action: UI Actions are used for both Legacy Workspace & Configurable Workspace, but only limitation such as the Action Bar component which is provided by default on the out-of-the-box record page. Its lead that UI Actions type is only supported on forms in workspaces and not lists function. 

 

Declarative Action: Declarative actions supported for configurable workspace & Workspace UI forms, lists & related list & those are work in both Workspace & UI builder pages, not require any customization an OOB UI builder page. Declarative action record is OOB functionality for Configurable Workspace.

 

Function of Declarative actions include:

 

1.List actions

2.Related list actions

3.Field decorators

4.Form

 

 Use Case 1: Based on few validations have to hide "Transfer Case" button from Configurable workspace.

 Use Case 2: If users are from India, then "Transfer Case" button is not visible for Indian Employee.

 

Solution Use Case1: In order to achieve this requirement, we have added script include in 'Script Condition' part under the Conditions tab of "Action Assignment [sys_declarative_action_assignment]" table within the record click Advanced view in the related links.

Please navigate to below table.

 

UX Form Action(sys_ux_form_action)

UI Action Type

Transfer Case

Declarative Action

Action Assignment (sys_declarative_action_assignment)

Action Label

Transfer Case

 

Refer the below screenshot:

abirakundu23_0-1720022844185.png

 

abirakundu23_1-1720023079056.png

 

 

 

 

 

 

 

Solution Use Case 2: In order to achieve this requirement, we can add in same way condition in Record Condition Part of 'Script Condition' field under the Conditions tab in "Action Assignment [sys_declarative_action_assignment]" table within the record click Advanced view in the related links.

abirakundu23_2-1720023958809.png

 

 

Please mark helpful & accept answer it its worthy for you!!

 

1 REPLY 1

anila5
Tera Contributor

Hi,

I have a requirement that if mandatory fields on case are not filled in, then hide "Transfer case" button from HR Agent Workspace. I tried scripted client scripts like  g_form.getMissingFields() == '' and g_form.mandatoryCheck() == true. But its not working. Can you help?