Use case: Configure an event handler with ServiceNow Otto
Summarize
Summary of Configure an event handler with ServiceNow Otto
This use case demonstrates how ServiceNow Otto simplifies configuring event handlers in Service Operations Workspace by automating the creation of binding expressions through natural language prompts. It addresses the complexity developers face when manually mapping event payload fields to page parameters for UI components.
Show less
Key Features
- Natural Language Configuration: Developers use ServiceNow Otto's input panel to describe event handler requirements in plain language, eliminating the need to manually write binding expressions.
- Automatic Payload Field Mapping: Otto identifies the correct destination pages and automatically binds event payload fields such as table names and sysid values to the appropriate parameters.
- Preview and Edit Capability: Developers can review generated bindings, accept them, or make edits using familiar form controls before saving.
- Support for Multiple Components and Events: The example covers configuring handlers for a button click event (navigating to an incident list) and reference link clicks in a task list (opening records in new tabs).
- Prerequisites: Requires installation of UI generation and the uibuilderadmin role for configuration access.
Configuration Steps
- Access UI Builder and open the Service Operations Workspace homepage.
- For the button component's click event, add an Open page or URL handler, then enter a natural language prompt describing the desired navigation.
- For the task list component's reference link clicked event, add a similar handler and provide a prompt specifying opening the record page in a new tab with table and sysid fields from the event payload.
- Review, accept, and save the generated event handler configurations.
Key Outcomes
- Event handlers are quickly and accurately configured without manual coding or detailed knowledge of payload structures.
- At runtime, the button navigates agents to the incident list with parameters correctly passed from workspace state.
- Reference links open the associated change request records in new tabs, with parameters automatically extracted from the selected row.
- Developers maintain full control to adjust configurations as needed before finalizing.
Automate event handler configuration without writing manual binding expressions.
Scenario
A UI developer is creating a Service Operations Workspace homepage for a service desk team. The homepage features two components: a button that directs agents to a list of open incidents, and a task list that displays open change requests. For the task list, when an agent selects a reference link in any row, the developer wants the associated change request record to open in a new tab, without requiring any additional navigation steps.
Problem
Without ServiceNow Otto, the developer must manually add an Open page or URL handler to the button component and configure both the destination page and the associated table parameter. For the task list, they need to add a second Open page or URL handler to the Reference link clicked event. Additionally, they must write binding expressions to map the event payload fields table and sys_id to the record page parameters. This process requires familiarity with the names of the payload fields, the binding syntax, and the parameter names expected by the record page, making it a complex configuration task for each handler.
Solution
With Event handler generation, the developer uses natural language prompts in the ServiceNow Otto panel to configure an event handler. ServiceNow Otto identifies the correct destination page, selects the appropriate event payload fields, and generates accurate binding expressions. The developer then reviews the preview and accepts the configuration without needing to look up payload field names or manually write any binding expressions.
Before you begin
Make sure that you install UI generation and that you have the ui_builder_admin role. For more information, see Install UI generation and Grant UI Builder admin role.
Configuration steps
- Navigate to .
- Open the Service Operations Workspace experience and navigate to the home page.
- Select the button component and open the Button clicked event.
- Add an Open page or URL handler. In the ServiceNow Otto input panel, enter the prompt: Open simple list page with table from state parameter.Tip:When writing prompts for Event handler generation, reference the specific destination page type and the fields you want to map by name. For reference link events, ServiceNow Otto displays the available payload fields in the panel — use these field names in your prompt for the most accurate results.
ServiceNow Otto identifies the simple list page, selects it as the destination, and binds the table parameter to the appropriate state parameter.
- Review the preview, select Accept and edit, and save the handler.
- Select the task list component and open the Reference link clicked event.
- Add a Open page or URL handler. ServiceNow Otto displays the available event payload fields. Enter the prompt: Open record page in a new tab with fields table and sysid from event payload.
ServiceNow Otto sets the destination to the record page, binds the table parameter to the payload’s table field, binds sysid to the payload’s sys_id field, and enables the Open in new tab option.
- Review the preview, confirm the bindings are correct, and accept the configuration.
Outcome
Both event handlers can be configured with natural language prompts. The developer could set them up quickly without looking up payload field names or writing binding expressions manually. During runtime, selecting the button navigates the agent to the incident list, with the table parameter automatically populated from the workspace's state. Additionally, selecting any reference link in the task list opens the corresponding change request record in a new tab, pulling the table name and sys_id directly from the selected row. The generated configurations are ready for immediate use. The developer retains full control and can edit any field using standard form controls before saving.