Use case: Generate a data binding and formula
Summarize
Summary of Use case: Generate a data binding and formula
This use case demonstrates how ServiceNow's UI Builder facilitates automatic generation of data bindings and formulas using natural language input, streamlining development for users unfamiliar with formula syntax. It focuses on a healthcare developer creating a self-service patient intake portal that requires dynamic label text and data-driven counts.
Show less
Key Features
- Natural Language Formula Generation: Developers describe their binding needs in plain language within the Formula Builder, and Now Assist converts this input into correct formula syntax automatically.
- Streamlined Workflow: The generated formula can be reviewed, accepted, edited, and applied directly to component properties without manual coding.
- Support for Dynamic UI Elements: Enables dynamic labels that adjust based on page context and data-driven metrics, such as counting active intake requests.
- Pre-Configuration Requirements: UI generation must be installed and the user granted the uibuilderadmin role.
How to Use
- Navigate to UI Builder and open the relevant experience and page variant.
- Select a UI component (e.g., label) and open the Data binding popover.
- Use the "Get started" option to input natural language prompts describing desired binding logic.
- For example, enter: "If the page is bare, show ‘Simplified View’; otherwise, show ‘Standard View’" to generate a conditional label formula.
- Review and accept the generated syntax, then apply it to the component.
- Similarly, prompt for data counts, e.g., "Enter how many active intake requests are there today?" to generate length-count formulas.
- Preview and test the page to verify correct dynamic behavior.
Key Outcomes
- Developers avoid memorizing or manually coding complex formula syntax, reducing errors and speeding up development.
- UI experience design is enhanced by enabling dynamic, context-aware UI components with minimal effort.
- Documentation lookup and peer dependency for formula syntax are minimized, improving developer productivity.
Automate data binding configuration without memorizing formula syntax.
Scenario
A developer at a healthcare organization is creating a self-service patient intake portal using UI Builder. The portal features a form that shows dynamic labels based on whether the user is viewing a standard page or a simplified "bare" page layout. The developer needs to configure a label component that changes its text accordingly. Additionally, the developer wants to display the total number of active intake requests submitted that day.
Problem
The developer is not familiar with UI Builder’s formula syntax. Writing expressions like IF(@context.props.bare,"bare page","not bare page") or LEN([list]) requires memorizing the exact syntax, which slows down development and increases the risk of errors. Every time the developer encounters a new binding requirement, they have to look up documentation or ask a colleague.
Solution
With Data binding generation, the developer describes what they need in plain language directly in the Formula Builder. Now Assist converts the natural language input into the correct formula or data binding syntax automatically. The developer reviews the generated syntax, accepts it, and applies it to the component property in one streamlined flow — without writing a single line of formula code manually.
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 .
- Navigate to the patient intake experience.
- Open the page variant in the Page Editor.
- Select the label component and open the Data binding popover.
- Select Get started.
- Enter the prompt: If the page is bare, show ‘Simplified View’; otherwise, show ‘Standard View’.Tip:Refer to the examples in the Data Binding popover to understand which types of natural language prompts are most effective. Prompts that clearly describe the condition and possible outcomes typically yield the most accurate results.
- Select the arrow to generate the binding.
Now Assist generates:
IF(@context.props.bare,"Simplified View","Standard View"). - Review the syntax, select Accept and Edit, then select Apply.
- Enter a prompt to request count label: Enter how many active intake requests are there today?
Now Assist generates:
LEN([@data.activeIntakeRequests]). - Preview and test the page to confirm both bindings render correctly.
Outcome
The developer sets up a dynamic binding quickly, without referring to the documentation. This eliminates syntax errors, enabling the developer to focus on experience design rather than writing formulas.