Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Create and customize alert messages in UI Builder

Learn how alert messages help you communicate feedback and status updates using both default and scripted approaches.

Alerts are components that display standardized notifications, such as feedback, warnings, and confirmations. They’re easy to configure without scripting, but you can add a script for more advanced functionality.

Image omitted: comp-ex-alerts-types.png
A series of different types of alerts.

UI Builder supports several types of alert messages. To see how each one behaves, open the Alert component documentation and try out different settings in the interactive preview.

Parent Topic:Learn components by example

Create alert messages in UI Builder

Add and configure alert messages for simple notifications without scripting.

Before you begin

Role required: ui_builder_admin

About this task

Use the default alert message configuration for simple notifications. In this example, the alert displays a personalized greeting using the logged-in user's full name.

This procedure uses UI Builder components to create dynamic, interactive layouts. For more information on how to configure components, see:

ComponentDocumentation links
Alert- Usage Guidelines - UIB Setup

[Omitted video] Description: Create and customize alert messages in UI Builder

Procedure

  1. Navigate to All > Now Experience Framework > UI Builder.

  2. Open an experience to work in or create an experience by selecting Create > Experience.

    See Configure how users interact with your applications in UI Builder for more information on creating experiences.

  3. Create a page from scratch.

    For more information about how to create a page, see Create a page in UI Builder.

  4. Add an alert.

    1. In the content tree, select + Add content.

    2. Search for alert and then select Add to place the component on your page.

    3. In the content tree, hover over Alert 1 and select the configure icon

Image omitted: uib-configure-icon.png
, then select **Rename**.
Image omitted: comp-ex-cam-rename.png
Additional actions menu in the content tree open for the alert component, with a cursor hovering over the Rename option.
4.  Replace the text in the **Component label** field with `Welcome Message`.

    The **Component ID** field auto-populates.

5.  Select **Apply**.
  1. Configure the alert message.

    1. With Welcome Message selected in the content tree, navigate to the configuration panel and set the following properties:

      FieldValue or Action
      TypeInfo
      Iconcircle-info-outline
      HeaderHeads up!
      Link(Leave blank) — select Edit, then delete any text inside Label and Href
      Action(Leave blank) — select Edit, set Type to -- None --, then delete any text inside Label and Href

      Your configuration panel should look like this:

Image omitted: comp-ex-cam-config.png
Configuration panel for alert, with highlights over the component label, Type, Icon, Header, Link, and Action fields.
2.  Hover over the **Message** field and select the bind data icon
Image omitted: uib-dynamic-data-binding-button.png
.
3.  Select **Formulas**, then **String**, then double-click or drag **CONCAT** to move the formula to the area above.
Image omitted: comp-ex-cam-bind-data.png
Bind data dialog showing CONCAT function with empty values.
4.  Double-click **value1** to select the field, then select again to insert text.

5.  Enter `"You're logged in as "`, making sure to include a trailing space after the exclamation point.

6.  Double-click **values** to select the field, then select again to insert text.

7.  Select **Data types**, then **Page properties**.

8.  Under **Pill view**, select the pills in the following order: **session** > **user** > **fullName**.

9.  Double-click or drag **fullName** to move it to the area above, then select **Apply**.
Image omitted: comp-ex-cam-bind-data2.png
Bind data dialog showing CONCAT function with "Welcome! " and @context.session.user.fullName as its values.
  1. Save and test your page.

    1. Select Save in the upper-right.

    2. Select Preview.

    The alert appears at the top of the page with the text "Heads up! You're logged in as " followed by the logged-in user's name.

Image omitted: comp-ex-cam-alert.png
Alert appearing under the header menu, greeting the logged-in user.

Customize alert messages with a client script in UI Builder

Use a client script to create dynamic, context-sensitive alert messages.

Before you begin

Role required: admin

About this task

Scripted alerts provide notifications that respond to events or external data. They are highly flexible and can react to complex conditions, but require scripting knowledge and more effort to maintain. In this example, a button triggers a client script that generates multiple alerts with custom messages.

This procedure uses UI Builder components to create dynamic, interactive layouts. For more information on how to configure components, see:

ComponentDocumentation links
Button- Usage Guidelines - UIB Setup
Alert- Usage Guidelines - UIB Setup

[Omitted video] Description: Create and customize alerts in UI Builder

Procedure

  1. Navigate to All > Now Experience Framework > UI Builder.

  2. Open an experience to work in or create an experience by selecting Create > Experience.

    See Configure how users interact with your applications in UI Builder for more information on creating experiences.

  3. Create a page from scratch.

    For more information about how to create a page, see Create a page in UI Builder.

  4. Add a button.

    1. In the content tree, select + Add content.

    2. Search for button and add it from the toolbox.

    3. In the content tree, hover over Button 1 and select the configure icon

Image omitted: uib-configure-icon.png
, then select **Rename**.
4.  Replace the text in the **Component label** field with `Showcase Alerts`.

    The **Component ID** field auto-populates.

5.  Select **Apply**.
  1. Create a client script.

    1. Under Data and scripts, select the + next to Client scripts.
Image omitted: comp-ex-cam2-client-scripts.png
Data and Scripts drawer with a highlight over Client scripts.
2.  Replace the text in **Script name** with `Alerts`.

3.  Replace the code with the following:

    **Tip:** You can select the format code icon
Image omitted: comp-ex-dfc-format-code-icon.png
to make the code more readable.
    ```
    /**
    * @param {params} params
    * @param {api} params.api
    * @param {any} params.event
    * @param {any} params.imports
    * @param {ApiHelpers} params.helpers
    */
    function handler({
        api,
        event,
        helpers,
        imports
    }) {
        api.emit("NOW_UXF_PAGE#ADD_NOTIFICATIONS", {
            items: [
                {
                    id: "alert1",
                    status: "critical",
                    icon: "circle-exclamation-fill",
                    content: {
                        type: "html",
                        value: "<h2>Critical: System failure detected!</h2>"                   
                    },
                    action: { type: "dismiss" }
                },
                {
                    id: "alert2",
                    status: "high",
                    icon: "circle-exclamation-outline",
                    content: {
                        type: "string",
                        value: "High: CPU usage exceeded 90%"
                    },
                    action: { type: "dismiss" }
                },
                {
                    id: "alert3",
                    status: "moderate",
                    icon: "circle-pause-outline",
                    content: {
                        type: "string",
                        value: "Moderate: Disk space is below 20%"
                    },
                    action: { type: "dismiss" }
                },
                {
                    id: "alert4",
                    status: "warning",
                    icon: "triangle-exclamation-outline",
                    content: {
                        type: "html",
                        value: "<h4> Warning: A new software update is ready. </h4>"
                    },
                    action: { type: "dismiss" }
                },
                {
                    id: "alert5",
                    status: "info",
                    icon: "circle-question-fill",
                    content: {
                        type: "string",
                        value: "Info: A new software update is available"
                    },
                    action: { type: "dismiss" }
                },
                {
                    id: "alert6",
                    status: "positive",
                    icon: "check-circle-outline",
                    content: {
                        type: "string",
                        value: "Positive: Backup completed successfully"
                    },
                    action: { type: "dismiss" }
                },
                {
                    id: "alert7",
                    status: "low",
                    icon: "bell-fill",
                    content: {
                        type: "string",
                        value: "Low: Minor update recommended"
                    },
                    action: { type: "dismiss" }
                }
            ]
        });
    }

    ```

4.  Select **Apply**.
  1. Link the button to the client script with an event.

    1. In the content tree, select the button we created: Showcase Alerts.

    2. In the configuration panel, select the Events tab.

    3. Under the Button clicked event, select Add handler.

    4. Search for alerts, then select the Alerts handler under Client Scripts.

Image omitted: comp-ex-cam2-events.png
Events dialog showing the handler for the Alerts client script selected.
5.  Select **Continue**.

6.  Select **Add**.
  1. Save and test your page.

    1. Select Save in the upper-right.

    2. Select Preview.

    Selecting the button displays multiple alerts with messages that you define in the client script.

Image omitted: comp-ex-cam2-alerts.png
UI Builder editor showing a button and a series of custom scripted alerts.