The Zurich release has arrived! Interested in new features and functionalities? Click here for more

sarah_bioni
ServiceNow Employee
ServiceNow Employee

Standard server-side messages like addInfoMessage or addErrorMessage do not automatically appear in custom Workspaces. This article provides a simple fix using UI Builder to manually map the notification behavior.

 

Problem:
When working with custom ServiceNow Workspaces, the traditional server-side messaging methods like addInfoMessage() or addErrorMessage() do not display messages to users as they do in the classic UI.

 

Root Cause:
Custom pages built with UI Builder do not automatically include logic to render these notifications. Instead, notifications must be explicitly handled through the component event mappings.


Solution (Step-by-Step):

  1. Open UI Builder
    Navigate to the UI Builder and select the page where you want the notification to appear.

  2. Select the Trigger Component
    Identify the component responsible for triggering the message (e.g., a list or a button). In my use case, it was a button inside a List component. 

    sarah_bioni_3-1746200869209.png

     

  3. Go to the "Events" Tab
    With the component selected, open the Events tab on the right-hand panel. 

    sarah_bioni_4-1746200894374.png

     

  4. Add an Event Mapping
    Click on "Add event mapping".

    • Name: Notification(s) displayed

    • Action: Add alert notifications

    • Items parameter: {{event.payload.notifications}}

    This tells the component to listen for notification payloads and render them as alert banners.                          

    sarah_bioni_5-1746200925428.pngsarah_bioni_6-1746200932087.png

     

  5. Test the Notification
    After this configuration, when your server script (e.g., in a UI Action or Script Include) calls addInfoMessage() or addErrorMessage(), the messages will be properly passed through and rendered by the UI component.

Comments
Community Alums
Not applicable

Thanks for your explanation, can you please explain more about how to put "{{event.payload.notifications}}" into the Action, it seems to me that there is a JSON data to be filled, but {{event.payload.notifications}} is not accepted in this.

sarah_bioni
ServiceNow Employee
ServiceNow Employee

Hi @Community Alums , I found it under the Events Payloads Queue — it's automatically loaded. Please see the image below.

sarah_bioni_0-1747847024423.png

 

nwilliam
Tera Contributor

is this possible with a catalog item component?  At least after reading this I believe that is my issue.

Version history
Last update:
‎05-02-2025 08:49 AM
Updated by:
Contributors