Use case: Configure an event handler with Now Assist
Summarize
Summary of Use case: Configure an event handler with Now Assist
This use case demonstrates how ServiceNow developers can leverage Now Assist's Event handler generation to simplify configuring event handlers in Service Operations Workspace without manually writing binding expressions. It focuses on automating the setup of navigation actions triggered by UI events, improving efficiency and reducing complexity.
Show less
Key Features
- Natural language prompts: Developers can describe the desired event handler behavior in plain language within Now Assist, which interprets the prompt to identify destination pages and event payload fields.
- Automatic binding generation: Now Assist generates accurate binding expressions mapping event payload fields (like table and sysid) to record page parameters, eliminating manual lookup and syntax errors.
- Support for common navigation scenarios: Examples include opening a list of records filtered by a state parameter and opening individual record pages in new tabs based on selected references.
- Preview and edit capability: Developers can review and modify the generated handler configuration before saving, retaining full control.
- Prerequisites: Requires UI generation installation and the uibuilderadmin role.
How It Works
- Navigate to UI Builder and open the target experience and page.
- Select a component and its event (e.g., Button clicked or Reference link clicked).
- Add an Open page or URL event handler.
- Enter a descriptive prompt in the Now Assist panel referencing destination page types and payload fields.
- Now Assist automatically selects the appropriate destination and binds parameters.
- Review, accept, and save the handler configuration.
Key Outcomes
- Developers save time by avoiding manual binding expression creation and payload field lookups.
- Event handlers behave as intended at runtime, such as navigating to filtered incident lists or opening record pages in new tabs directly from task list references.
- Configurations are immediately usable and customizable through standard editing controls.
- The approach reduces configuration errors and speeds UI development in Service Operations Workspace.
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 Now Assist, 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 Now Assist panel to configure an event handler. Now Assist 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 Now Assist 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, Now Assist displays the available payload fields in the panel — use these field names in your prompt for the most accurate results.
Now Assist 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. Now Assist displays the available event payload fields. Enter the prompt: Open record page in a new tab with fields table and sysid from event payload.
Now Assist 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.