User500395
ServiceNow Employee

Here is some insights regarding Declarative Actions and their significance in our workspace. Traditionally, when we needed to incorporate buttons into the workspace, we would simply add the button component in UI Builder adjacent to action bar. However, this approach is not considered the correct or recommended method due to several defects and limitations.

 

Some of the issues we encountered with the button component include scenarios where the button was visible during page loading and situations where the button extended beyond the visible page area (CSS issues), particularly in Vancouver. 

 

To overcome these challenges and improve our button implementation process, it is recommended to leverage either UI actions or Declarative Actions. While UI Actions are restricted to the Action Bar component within Workspace and similar experiences, Declarative Actions offer greater flexibility and can be utilised in various components, including the Action Bar on records, related lists, and lists. The advantage of Declarative Actions is that they can be employed without requiring modifications to the UI Builder page itself. 

 

By adopting Declarative Actions instead of adding buttons through UI Builder, we can enhance the upgrade experience. Declarative Actions do not customize the out-of-the-box UI Builder page; rather, they create the necessary records within our app scope, ensuring a smoother upgrade process.

 

Quick go through to add button on form as declarative action:

Navigate to Workspace Experience > Actions & Components

  1. create an Action Assignment and implement it as a UXF Client Action
  2. create a new Action Payload Definition (sys_declarative_action_payload_definition).
  3. create form UX form action. (sys_ux_form_action)
  4. Configure UX Actions Configuration (sys_ux_action_config) (By adding newly created action assignment)
  5. From the Action Configuration record, create this m2m record via the related list All Declarative Action Assignments. 
  6. Create UX Form Actions Layout (sys_ux_form_action_layout) 
  7. Update the Sys Ux M2M Action Layout Item (sys_ux_m2m_action_layout_item) record. Note that this record is auto-generated, so it is recommended to open it and change the table name from "Global" to the appropriate one for your use case.
  8. If you need to trigger any event in UIB, create the record UX Add-on Event Mapping (sys_ux_addon_event_mapping) accordingly with the target event.

flow for implementing Declarative Action.flow for implementing Declarative Action.

 

Related threads to know more :

Video : https://www.youtube.com/watch?v=C8KDDHUvNO8

Community Threads : Link1, Link2, Link3

Thanks for reading the blog and do provide your inputs/suggestions if any.

Hope you find this article helpful. Don’t forget to Mark it Helpful.

2 Comments