Configure an event handler

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 1 minute to read
  • Add an event handler to a page, component, data resource, or declarative action within UI Builder so that your user can trigger an action.

    Before you begin

    Role required: ui_builder_admin

    About this task

    An event handler lets you configure an action, components, data resource, or declarative action on your page. For example, you can map an event to your page to add an alert notification when the page successfully loads or you can add an event handler for a button component to perform an action when a user clicks it. The event handler could also be a modal on your page that asks a user to verify that the user wants to delete the record. For more information, see Manage actions in UI Builder pages (advanced feature).

    Procedure

    1. Navigate to All > Now Experience Framework > UI Builder.
    2. Open an experience to work in or create an experience by selecting + Create.
    3. Open or create a page.
      For more information about how to create a page in UI Builder, see Create a page in UI Builder.
    4. Add a component to your page, such as a button.
      For more information about adding components to a page, see Add and configure components.
    5. To add an event handler to your component's event, go to the configuration panel and select Events.
      An event handler lets you assign an event to a component. For example, if you add a button component to your page, you want it to perform an action when a user clicks it.
    6. To start the process of assigning an event to a component select + Add event mapping.

      Some components, such as the button component, only have one event mapping. Other components can have many events.

      Arrow pointing to add event mapping option.
    7. Select an event mapping that you want to configure from the list.
      List of available event mappings.
    8. From the Event handler preview screen, select an action that you want assigned to the component.
      Clear alert notifications when a row is clicked in a list.
    9. Select Add.
    10. Select Save.

    Result

    The configured event handler displays in the events tab of the configuration panel.

    Configured event mapping for clear alert notifications.