UI Builder 101 - ServiceNow Community
MGOPW
ServiceNow Employee
ServiceNow Employee

UI Builder 101

 

The following article accompanies the UI Builder 101 video by Chris Johnson. Below, you will find explanations for concepts and resources mentioned in the video. Please ask any questions in the comments below!


Introduction

This article is meant to be a companion to the UI Builder 101 video, it will recap most of what is covered in the video for those of us who prefer to read in lieu of watching an hour long video. It can serve as reference, provide links mentioned in the video, and expand on some points provided in the video that we did not go in to detail about. Please feel free to provide us any feedback in the comments below.

 

If you're looking for more opportunities to learn UI Builder, and further your learning, check out the links below. We always suggest to start with the UI Builder Fundamentals course if you have access to it on Now Learning, and then do the workshops provided in the Next Experience Workshops site. We have content there for all learning levels, so be sure to check it out!

 

 

Context

ServiceNow is a highly flexible platform designed to adapt and meet the needs of various businesses. What makes it stand out is its ability to work seamlessly across departments, whether in IT, HR, customer service, or finance. Initially founded over 20 years ago by Fred Luddy as GlideSoft, the platform was originally built to manage IT operations, ticketing, and asset management. By 2006, GlideSoft became ServiceNow, and the platform evolved beyond IT, offering workflow solutions across many enterprise functions.
 
This growth into a comprehensive workflow system has been crucial to ServiceNow’s success. One of its major strengths lies in its integration capabilities, allowing it to sit at the core of an organization's operations. ServiceNow functions as a "control tower" for the enterprise, integrating with various business systems to drive cohesive operations across multiple departments.
 
In terms of web experiences, ServiceNow offers three main types. The first is Core UI, which has been a constant in the platform’s history. This interface, sometimes referred to as UI16 or Classic Environment Lists and Forms, was primarily designed for those fulfilling requests, like IT agents managing tickets. While functional, this UI was not ideal for customer-facing interactions.
To address more visually engaging experiences, ServiceNow introduced Service Portals, which use AngularJS. Portals allow businesses to create interfaces tailored to both employees and customers, aligning with their brand and offering a more user-friendly experience. Many businesses are familiar with the Now Support Portal as an example of this design.
 
However, the evolution didn’t stop there. ServiceNow’s latest web experience is built on the Next Experience UI Framework, internally called Seismic. This modern framework powers Workspaces, builders, and many administrative tools, making it the backbone of how companies build and customize their ServiceNow instance today. The framework represents a significant leap in flexibility and power for creating intuitive web experiences.

Our Web Ecosystem

When it comes to building web experiences on ServiceNow, the platform’s history is a mix of different technologies, each serving a specific purpose at different times. In the early days, customizing the Classic Environment forms relied heavily on Apache Jelly, an XML-based templating language. While functional, Jelly has long been recognized as outdated, limited in its flexibility, and not equipped to handle the complexities of modern user interfaces.
 
As ServiceNow grew and the need for more advanced UIs arose, other front-end technologies were adopted to fill the gaps that Jelly could not cover. Angular Service Portals, for example, were built using AngularJS, an early front-end framework developed by Google. However, AngularJS has since become obsolete and is no longer supported, creating challenges for long-term sustainability. ServiceNow maintained its own fork of AngularJS to ensure stability and security for its customers, but it’s clear this approach added complexity rather than streamlined solutions.
This patchwork of different frameworks created a fragmented development process. For example, customer-built widgets were confined to specific interfaces—like Portals—and couldn’t easily be reused in other environments such as Classic Environment or Configurable Workspace Experiences. This led to inefficiencies, where teams had to rebuild the same functionality multiple times to accommodate each UI.
 
Although the platform’s back-end remained stable, the inconsistency in front-end technologies made development slower and more difficult.
 
Recognizing the need for standardization, ServiceNow introduced the Next Experience UI Framework. This modern framework represents the future of ServiceNow web experiences, providing a unified system for developing user interfaces across all parts of the platform. With this shift, the platform has begun to consolidate its technologies, enabling faster development, more consistent user interfaces, and the ability to leverage modern web capabilities. The move to the Next Experience UI Framework marks a pivotal moment in ServiceNow’s evolution, bringing a new level of cohesion to its web experiences.

Web Components

The Next Experience UI Framework is ServiceNow’s modern front-end architecture, built specifically by ServiceNow for ServiceNow. Unlike previous frameworks like Jelly, React, or AngularJS, this new framework is constructed using modern web standards, including the Web Components API. Web Components are a powerful tool that allows developers to create reusable, encapsulated HTML elements that are native to the browser, offering performance advantages over older, proprietary systems.
 
Web components bring several key features to the table. At their core, they use something called the “Shadow DOM,” which encapsulates the HTML and CSS within a component. This means that any styling or functionality inside the component is isolated from the rest of the page. Styles from other parts of the page can’t affect the component, and similarly, the component’s styles can’t bleed out and interfere with the rest of the web experience. This encapsulation ensures that components remain predictable, maintainable, and free from unintended side effects caused by external styles or scripts.
 
Another fundamental aspect of web components is the use of custom HTML elements. These elements are fully functional, standards-compliant pieces of the DOM (Document Object Model). For example, a button in the ServiceNow UI Framework would have a specific custom HTML tag that defines it, <now-button>, along with attributes that the framework uses to drive functionality. These custom elements work seamlessly within the modern browser environment, adhering to web standards while remaining flexible enough to meet ServiceNow’s unique needs.
 
Although ServiceNow’s web components are built using these standard principles, they remain proprietary to the platform. The ServiceNow library of components continues to grow with each platform release. As of the Washington D.C. release, UI Builder includes over 150 components, many of which are documented in the Horizon Design System. This resource provides detailed usage guidelines, API documentation, and Figma files for developers and designers to access.
 
The adoption of web components within the Next Experience UI Framework is a critical step forward in modernizing ServiceNow’s web experiences. It not only ensures consistency across the platform but also enables faster development cycles, increased maintainability, and better performance in the browser.
 
 

Widgets vs Components

A common question is how components in the Next Experience UI Framework differ from Angular widgets used in the Service Portal. While they share some conceptual similarities—both being reusable elements in a UI—the differences between them are significant, particularly in how they are managed and maintained.
 
Both components and widgets are built with reusability in mind, allowing developers to assemble pages using a library of these elements. However, unlike the Service Portal approach, where you can clone and modify an Angular widget, components in the Next Experience UI Framework are designed to be immutable—you cannot clone them. This is a deliberate shift in philosophy.
 
In the world of Service Portal, cloning a widget means taking ownership of its code. Once you clone it, you’re responsible for maintaining that widget over time. Any updates, enhancements, or security fixes made to the original widget by its author are no longer applied to your cloned version. This creates a maintenance burden, where developers are forced to track and update each widget themselves. Over time, managing these cloned widgets can become cumbersome and expensive, especially as the ecosystem grows and diversifies.
 
Another challenge in the Service Portal ecosystem is redundancy. Thousands of widgets have been created, many of which offer similar functionality but differ slightly. This duplication can create confusion, slow down development, and increase costs as developers must navigate through an overwhelming number of options without clear guidance on which widget is most appropriate.
 
ServiceNow’s earlier UI approaches, whether using Jelly-based UIs or Angular-based Portals, also often involved direct manipulation of the DOM (Document Object Model). This practice made it difficult for ServiceNow’s product teams to enhance or update the platform without the risk of breaking customer implementations. Customizations made by altering the DOM directly made upgrades complex and fraught with compatibility issues.
 
The Next Experience UI Framework, with its emphasis on web components, was developed to address these challenges. By preventing cloning and ensuring components are encapsulated, ServiceNow can deliver a consistent, stable, and secure experience. Web components don’t allow for code or style injection, which helps ensure that updates and improvements can be applied seamlessly without breaking customer customizations. This approach not only simplifies maintenance but also provides a more solid foundation for future development, enabling more predictable and reliable platform upgrades.
 
By moving away from the widget-cloning model and toward reusable, maintainable components, ServiceNow is creating a more streamlined and efficient ecosystem for UI development. This shift helps avoid redundancy, reduces maintenance burdens, and ensures that future enhancements are delivered smoothly
 

Our Components

Components in the Next Experience UI Framework function like LEGO blocks, allowing developers to assemble various UI elements into dynamic products and experiences. ServiceNow maintains a library of reusable components, ranging from generic pieces like buttons, headings, and input fields to more specialized, complex components tailored for specific applications.
 
ServiceNow's aim is to create components that are versatile enough to be reused across multiple contexts and products, ensuring efficiency and consistency. For example, the same components used in Configurable Workspace are also found in Catalog Builder, CSM Workspace, and even the Unified Navigator.
 
Components often consist of smaller components. A good example is the activity stream component, which is built using other components like icons, headings, and buttons. To enhance flexibility, each component has a configuration API that adjusts its appearance and functionality, with backward compatibility maintained to support future upgrades.
 
Components are interactive and emit events, which follow a "Props Down, Events Up" architecture, where data flows down through properties, and events with payloads propagate upwards. ServiceNow also ensures that components meet high standards, including compliance with WCAG accessibility guidelines, compatibility with internationalization, and seamless performance in different themes.
For developers seeking customization, ServiceNow enables the creation of custom components using their own development environments, which will integrate seamlessly into UI Builder.
 
With a growing library of components, ServiceNow offers a flexible and scalable foundation for building consistent and interactive experiences across the platform.

 

Metadata

ServiceNow's low-code platform relies heavily on metadata to simplify complex configurations and reduce the need for coding. Metadata is structured data that describes other data, allowing for abstraction over the complex systems built by ServiceNow engineers.
 
In practical terms, metadata is used to define almost every aspect of the platform, from database structures and UI elements like forms and lists to rules governing data access and behavior. This abstraction layer enables users to configure instances without writing traditional code.
 
For example, building a form from scratch with HTML, CSS, JavaScript, and SQL would require significant effort. In ServiceNow, the same form can be created much faster using metadata, which defines data storage, field behavior, security rules, and more. When a form is rendered in the browser, it pulls metadata from various tables to determine its appearance and functionality.
 
This powerful approach to metadata allows users to quickly configure and adapt their instances, tapping into a vast array of pre-built features and structures without needing to directly manage complex code.
 

Metadata Powered UIs

ServiceNow’s Core UI exemplifies a metadata-driven approach, allowing users to create functional forms and lists without writing code. As metadata is modified, the UI automatically updates, reflecting those changes in real-time.
 
To manage complex metadata, ServiceNow provides tools known as Builders or Designers, which simplify the creation and configuration process. Examples include Form Designer, Mobile Studio, Process Automation Designer, and UI Builder. These tools help users build components while generating the necessary metadata behind the scenes.
 
In contrast, the Service Portal relied heavily on AngularJS coding, which often intimidated ServiceNow admins due to the fear of breaking the portal with changes. Although the Service Portal offered a highly customizable and visually appealing interface, it lost the low-code accessibility that Core UI provided.
 
The new web platform aims to combine the advantages of both worlds: creating visually rich UIs backed by metadata rather than extensive coding. While product teams and users can create components with code, these components are primarily configured through metadata records.
 
However, achieving a visually rich experience, like that found in Workspaces, requires complex metadata. Next, we will delve deeper into the concepts of Experiences and Macroponents to understand this metadata in greater detail.
 

Experiences and Macroponents

An experience refers to the user interface of a specific part or workflow within an application, encompassing various types such as Workspaces and Portals, as well as other tools built on the modern web platform, including UI Builder. Experiences are managed in the sys_ux_page_registry table and can be found under the Now Experience Framework module in the "All" menu.
 

Key Features of Experiences:

  • URL Structure: Each experience is accessed via a unique URL, structured as a child URL of the experience's root URL (located after /now/ on your instance).
  • Landing Page: Users are directed to a default landing page when they access the experience URL.
  • App Shell UI: Each experience includes an App Shell UI, which consists of common UI elements across all pages within that experience. This "App Chrome" frames where individual pages are rendered and is configured primarily in Core UI and UI Builder.
  • Functional Elements: The App Shell is responsible for crucial functionalities, such as loaders, login/logout interfaces, help features, and search configurations.

 

Example of a Workspace Experience

 

MGOPW_0-1732216581694.png
 
For instance, a workspace accessible at the /agent URL would typically have:
  • A default page located at /home, often featuring dashboards or analytics.
  • A list page at /list.
  • A record page at /record.
  • A customizable vertical icon list and tabs or breadcrumbs for navigation.

Parent App Shells

Introduced in the San Diego release, the unified navigation system (Next Experience UI) employs a Parent App Shell that encompasses multiple experiences. When an experience resides within a Parent App Shell, it inherits certain functionalities, such as centralized search, help, user profiles, and theming management, which takes precedence over the individual experience theme.
All these elements are integrated into the Next Experience UI Framework. Next, we will explore a specific type of metadata used in creating these experiences: the Macroponent, which can be created and edited in UI Builder.
 

Macroponents

Macroponents are a fundamental part of ServiceNow’s metadata architecture, stored in the sys_ux_macroponent table. Although the term might sound complex, it's essential to understand its significance due to its widespread use across various modern experiences. Macroponents serve multiple purposes, including page composition, components, controllers, viewports, modals, and modeless dialogs. You'll encounter the term "Macroponent" throughout various UI Framework tables and fields, particularly in Core UI.
 

Exploring the Macroponent Record

 

MGOPW_1-1732216718466.png
 
Update Set is provided in the attachments section of this article.
 
You can access a Macroponent Record in UI Builder through the Developer > Open Page Definition menu. While it’s generally advisable to avoid manually writing complex JSON, UI Builder is designed to handle this effectively. However, understanding the structure of a Macroponent is crucial.
 
MGOPW_2-1732216785396.png

 

 

A Macroponent can be thought of as the metadata ingredients that assemble the final web page sent to a user’s browser. These ingredients include:
 
  1. Layout: Defines the overall structure and rendering rules of the Macroponent. Any changes made to the styles for the “Body” or “Root” element in UI Builder will reflect in this field. The layout model has evolved to support enhanced capabilities, including responsive design.
  2. Composition: This field houses the components and their configurations. For instance, if you create a page in UI Builder with a heading, a button, and an image component, all these elements and their configurations will reside in the composition field. When you modify the metadata in the Macroponent, such as changing a heading label, the updates will be visible upon refreshing the page.
  3. Events: Events play a crucial role in the interactivity of your components. For example, a button click event might be mapped to open a modal, and this mapping is reflected in the Macroponent record. Events can become complex, and they often require relay mappings to communicate with the App Shell for actions like opening and closing modals. For more information on Events, check out this community article.
  4. Data: The data field contains a list of data resources and their configuration values. Data resources, akin to components, have configuration properties and events but do not have a user interface. Instead, they output data based on their configuration. For example, if you configure a "Lookup a single record" data source to retrieve a record from the Task table, a GlideQuery fetches the desired fields. Changes to the configuration of a data resource automatically update the output, allowing for flexible data binding on the page.

Client Scripts

In earlier versions, client scripts were part of the Macroponent record. However, they now reside in separate records within the sys_ux_client_script table. You can view the associated client scripts for a specific Macroponent in the related list at the bottom of the record.
 
With an understanding of the Macroponent structure, let’s transition to UI Builder to see how these elements come together in practice. Here, we can explore how to create and configure Macroponents effectively, leveraging the capabilities of the platform to build rich user experiences without needing extensive coding knowledge.

UI Builder

MGOPW_0-1732217536894.png

 

UI Builder (UIB) is ServiceNow's powerful UI configuration and authoring tool that was introduced in the Quebec release. It is designed to enable users to build and customize applications atop ServiceNow's new framework. UIB serves as the primary tool for both ServiceNow product teams and customers, allowing them to create tailored user experiences with minimal coding.
 
 

Key Features and Benefits

  1. Continuous Investment: ServiceNow is committed to the ongoing development of UIB and its underlying framework. By moving UIB to the ServiceNow Store, the frequency of releases has significantly increased, allowing for more frequent enhancements and new features.
  2. Low-Code Environment: UIB is a low-code tool that allows users to customize existing products, like the Service Operations Workspace or Customer Support Workspace. Additionally, users can build entirely custom application UIs, empowering them to create solutions that meet specific business needs.
  3. User-Friendly Interface: When you open UIB, you're greeted with a comprehensive inventory of editable elements. This includes a list of Experiences and Page Collections, with future updates planned to incorporate other types of editable elements.
  4. Support Resources: UIB provides a wealth of resources to help users get started, including help content, tutorial videos, and additional documentation. This ensures that users have the support they need to maximize their use of the tool.

 

Getting Started

To demonstrate the capabilities of UIB, let’s select the demo experience, which you can install from the resource community post. This experience serves as a practical starting point, showcasing how UIB can be used to create and configure a variety of user interfaces. As we delve into the demo experience, we’ll explore its elements and how they can be customized to fit organizational requirements.
 
When you access an experience in UI Builder, you encounter what we refer to as the Experience View. This interface lists all the pages and their variants within the selected experience, along with options to edit and configure each component.
 
MGOPW_0-1732219035503.png

 

Understanding Pages and Variants

Pages:

  • Each page within an experience can host one or more variants.
  • Similar to Form views in tables, a page has a designated name and URL path, and it may include Required or Optional parameters.
  • When a user navigates to a URL associated with an experience, they are directed to a specific page.

Variants:

  • The variant represents the actual user interface presented to the user.
  • While multiple records facilitate this process behind the scenes, it’s helpful to conceptualize the variant primarily as the Macroponent record.
  • Variants can be tailored based on criteria to determine which specific variant will be displayed.
  • For example, workspaces often include multiple record page variants targeting distinct tables, such as a different record page for the user table versus the incident table.
  • When creating a variant, you establish the criteria and order for display. The most specific variants should have the lowest order value, while the more general ones should have a higher order value.

Pages can be targeted to specific user criteria using audiences, offering a powerful customization feature. You can find more information on audiences in this ServiceNow Docs article.
 

Parameters in Pages

Required Parameters:

  • These parameters are essential for loading a page. If they are not provided, the page will not render and will return a 404 error.
  • Taking the standard workspace record page as an example, it requires two parameters: Table and SysId.
  • Any number of required parameters can be defined at the page level, and all variants of that page will require these same parameters.

Optional Parameters:

  • Optional parameters allow for added functionality without hindering the page’s accessibility.
  • The workspace record page, for instance, includes four optional parameters: query, extraParams, views, and selectedTab.
  • When navigating between tabs on a record page, the selectedTab parameter changes, allowing users to copy links that maintain their tab state for others.

Parameter Order and Management

  • Required parameters are always listed first in the URL, and the order of these parameters is crucial.
  • Optional parameters follow the /params/ segment in the URL and are order-agnostic due to their label-value structure.
  • If you add or remove any required parameters after creating links, you must update those links to ensure they contain the necessary parameters; otherwise, users will encounter a 404 error.

Page Editor

 

MGOPW_0-1732222772626.png

 

The UI Builder editor is designed to facilitate the creation and customization of pages, structured into three main regions: Inventory, Stage, and Configuration.
 
Let’s explore each of these areas in detail.
 
Inventory
The Inventory section displays a content tree that outlines all the containers and components present on the page. This is roughly equivalent to the Document Object Model (DOM) structure. Below the component listing, you'll find:
  • Data Resources: Lists all data resources associated with the page.
  • Client Scripts: Displays any client-side scripts that are linked to the page.
  • Client State Parameters: Shows the parameters that help manage the state of the client interface.
You can select components either by clicking directly on them in the Stage area or by selecting them from the content tree in the Inventory.
 
Stage
The Stage area is where the actual page preview is displayed. This is where you can see how the components will appear to end-users as you edit and configure them.
 
Configuration
The Configuration panel on the right side changes based on the selected component, offering specific configuration options divided into three tabs:
  • Config: Here, you can adjust the various settings and properties for the selected component.
  • Styles: This tab controls the visual aspects of the layout and CSS for the component.
  • Events: In this section, you can configure the events associated with the component.
To better understand how each component operates, you can refer to the Horizon Design System website, which provides documentation and guidance on many of the available components in UI Builder.
 

Styles Tab

The Styles tab allows for visual configuration of components and layout through CSS. However, remember that many visual properties are dictated by the theme set in your instance. For instance, background colors for buttons typically derive from the theme rather than being adjusted directly in UI Builder. To customize these properties, you would use Theme Builder, which you can install from the ServiceNow Store for easier theme management.
 
 
Within the Styles tab, you can control:
  • CSS for Components: Customize the appearance of individual components.
  • Page Layout CSS: Adjust how the entire page is presented visually.
UI Builder utilizes modern CSS features such as Flexbox and Grid for layout management. If you're not familiar with these technologies, there are numerous resources available on sites like MDN (Mozilla Developer Network) that provide tutorials and explanations.
 

Layout Management

 

Simple Page Layouts
For straightforward pages, starting with basic column layouts is recommended, as these layouts are easy to configure without extensive CSS knowledge. UI Builder supports layouts with up to six columns and includes common column arrangements for quick setup. Additionally, columns allow you to adjust their count with ease (e.g., transitioning from two columns to three).
 
MGOPW_2-1732223294652.png

 

 
Complex Page Layouts
For more complex designs, you can implement Flexbox or Grid containers:
  • Flexbox: Typically used for one-dimensional layouts, Flexbox is user-friendly and facilitates arrangements in either horizontal or vertical directions. By default, blank pages in UI Builder are set to a vertical flexbox layout.
  • Grid: A two-dimensional layout system that is particularly useful for handling variable datasets. For example, if you’re querying the incident table for records assigned to a user, the data volume can fluctuate greatly.
 
Using a grid layout allows you to define a structure, such as a card layout with up to five cards wide, which automatically adjusts as new data is added. You can configure the grid to display a set number of rows and columns, while the browser takes care of dynamically generating additional rows based on the dataset size.
 
Understanding the page editor and its components is crucial for effective UI design in ServiceNow. The flexibility provided by both Flexbox and Grid layouts ensures that you can accommodate a variety of use cases, from simple forms to complex data presentations. 
 

Events

In the UI Builder editor, the Events configuration tab plays a vital role in establishing interactions within your application. Here's a closer look at how events function and their significance in enhancing user experience.
 
Overview of Events
  • Types of Events: Events can range from straightforward actions, such as a user clicking a button, to more complex triggers that fire when data is loaded successfully or fails to load. Not all components will have events associated with them, and some may have multiple events defined.
  • Default Behavior: By default, events do not perform any action until they are connected to an event handler. This connection is referred to as event mapping.
MGOPW_3-1732223425657.png

 

Example of Event Mapping
For instance, if you want a button to navigate to servicenow.com when clicked, you would:
  1. Identify the Button Clicked event.
  2. Bind this event to the “Link to Destination” event handler.
This action allows the button to respond effectively to user interactions. Essentially, events act as the "glue" that connects various interactions within the UI.
 
Common Event Handlers
Here are some examples of event handlers that can be associated with events:
  • Page Navigation: Transitioning the user to a different page.
  • Displaying Modals or Popovers: Triggering pop-up windows for additional information.
  • Client Scripts: Running client-side scripts based on user actions.
  • Changing or Setting Client State Parameters: Updating parameters to reflect changes in the UI.
  • Loading Animations: Indicating that data is being processed or loaded.
Multiple Handlers for a Single Event
An individual event can be linked to multiple event handlers, providing greater flexibility in response to user interactions. Furthermore, data resources—discussed in the next section—can also introduce additional event handlers to your page, so the number of handlers may vary depending on the specific configuration of the page.
 
Lifecycle Events
In addition to component and data resource events, UI Builder supports lifecycle events such as macroponent_ready and macroponent_property_changed. These events are triggered at various points in the lifecycle of a page or component and can be particularly useful for managing state and transitions.
 
UI Builder's user interface is designed to feel familiar and incorporates patterns found in other WYSIWYG (What You See Is What You Get) UI building tools. However, it differs from simpler tools in that it emphasizes data-driven applications rather than static web pages or marketing sites. UIB is tailored for constructing complex web applications that can drive organizational processes and efficiencies.
 

Data & Data Resources

In the context of web applications, particularly within ServiceNow, data plays a crucial role in enabling dynamic and data-driven experiences. As you develop applications, it's essential to manage workflows, processes, and integrations that often involve complex data interactions.
 
Understanding Data Resources
  • Definition: Data Resources are integral components within UI Builder that provide a means to access and manipulate data. They are akin to other components, as they are added to the macroponent using JSON, have configurable options, support events, and are designed for reuse.
  • Data Resources can:
    • Query Data: Retrieve information from a ServiceNow instance using Glide queries or custom GraphQL queries.
    • Transform Data: Alter the format of data to suit specific requirements.
    • Read and Write: Both read data from and write data to a ServiceNow instance.
 
Automatic Data Provisioning
The App Shell automatically supplies certain user and session data to the pages it encompasses. This includes essential information like:
  • User name
  • Roles
  • Local timezone
  • Preferences
This automatic data provisioning simplifies the initial setup of pages and enhances user experience by providing relevant context without requiring additional configuration.
 
Building and Reusing Data Resources
Data Resources are developed by various teams within ServiceNow and are readily available in UI Builder. Developers can also create custom Data Resources tailored to their application's needs. On complex pages, multiple Data Resources may coexist, creating intricate relationships between components, data, state, and page scripts.
 
Introduction of Controllers
In the Tokyo release, a new type of Data Resource called a Controller was introduced to improve the organization of data and business logic on complex pages.
  • Role of Controllers:
    • Think of a Controller as a container or folder that encapsulates the data, business logic, and state information required to manage a complex page or specific use case within a page.
    • Controllers can include any number of Data Resources, Client Scripts, and Client State parameters, which helps simplify the data management process.
  • User Experience Enhancement:
    • When the standard Workspace record page transitioned to this Controller paradigm, the number of visible items in the data panel was drastically reduced from over 20 to just 1. This consolidation helps users navigate and configure their pages more effectively.
    • Each Record Page Controller offers an output API that supplies the necessary data to all components on that page.
  • Backwards Compatibility: ServiceNow-built Controllers follow a defined API contract, ensuring backwards compatibility. The internal workings of Controllers are concealed from users, allowing authors to update and enhance the Controller without affecting the user experience.

 

Data Binding

In ServiceNow, data binding is a key feature that allows components to dynamically interact with data sources. This dynamic interaction is essential for building complex, workflow-driven applications rather than simple static websites. Here’s a deeper dive into how data binding works and its significance in UI Builder.
 
Understanding Data Binding
  • Definition: Data binding is the process of connecting a component to a data source. It allows components to pull in data from various origins as long as the data is formatted correctly for the component.
  • Sample Data: When a component is added to a page, it initially comes with sample data to illustrate how it functions and what it looks like. For instance, the heading component may default to the label: "We make work, work better for people with modern digital workflows." This can be customized to any text that fits your needs.

 

Dynamic Data Usage
Most components are designed to utilize dynamic data rather than static values. This is exemplified on the workspace record page, where the heading at the top is bound to the short description of the record.
  • Personalization Example: When a user logs into the instance and sees a greeting such as "Hi, Chris," the heading component retrieves the user's first name from the session data and concatenates it with a greeting string. This creates a personalized experience, as each user sees their name reflected in the same component.
MGOPW_5-1732223929470.png

 

 

Flexible Data Binding
  • Versatility: Any configuration property of a component or data resource within UI Builder can be bound to data. This includes various data types such as strings, booleans, choices, references, arrays, and complex objects. Beyond components, event mappings, scripts, and client state parameters can also leverage data binding.
  • Data Binding Syntax: Data binding employs a "dot walk" syntax that acts as an address for a specific part of the data output. For example, the address for the short description in the Record Controller might look like: @Data.record.form.header.primaryItem.displayValue
Although this may appear lengthy, it ensures that components can access the extensive data they require.
 
User-Friendly Data Binding Interface
  • Visual Data Navigation: UI Builder provides a data UI that allows developers to visually navigate the output. This feature enables users to drag and drop "data pills" for easy data binding without needing to type long addresses manually.
  • Functions: The data UI supports functions like Concatenate, which can help reduce the need for scripting in many cases, simplifying the development process.
MGOPW_6-1732223996349.png

 

Switching from Static to Dynamic Binding
To convert an input property from a static value to data binding:
  1. Hover over the Configuration Property. This action reveals the option to switch to data binding.
  2. Click the Database Icon. This initiates the data binding process, allowing you to connect to the desired data source.
ServiceNow's product experiences are designed for configurability and customization while remaining upgradable over time. This ensures that users can benefit from enhancements and improvements to the platform while retaining their specific configurations and customizations.

Upgrades, Presets & Controllers

In ServiceNow's UI Builder, the concepts of upgradability, presets, controllers, and components are essential for creating dynamic and maintainable applications. Let's break down these concepts further.
 
Components
  • Automatic Upgrades: One of the primary advantages of using ServiceNow components is that you receive automatic upgrades and improvements. You always use the latest version of UI Builder components, such as buttons, forms, lists, headings, and over 150 others, without needing to make any changes.
  • API Contracts: ServiceNow ensures that component APIs are supported through an API contract, meaning the functionality remains stable even after upgrades. Components that come from plugins or store apps may update more frequently, but the principle of automatic upgrades applies to custom components as well. Any changes made to custom components will reflect across all pages utilizing them, so it's crucial to be aware of how changes to the component API might impact existing pages.
Controllers
  • Similar to Components: Controllers, much like components, maintain an API contract, ensuring that changes do not disrupt the pages that depend on them. Any alterations made to a controller automatically apply to every page that uses that controller.
  • Encapsulation: Controllers encapsulate data fetching, business logic, and state, providing a structured approach to manage complex workflows and applications.
Presets
  • Presets were introduced in the Tokyo release to encapsulate configuration in an upgrade-friendly manner and speed up page building. They allow for the automatic configuration of components and data by connecting components to a controller.
  • Use Case Example: A common use case involves the heading component displaying the primary field (often the short description). When you select the heading component and choose the "Record title" preset, the preset automatically sets all necessary configuration properties to bind the heading to the primary field data.
  • Form Controller Integration: If no controllers are present on the page, the preset will add a Form Controller to facilitate querying the short description from the database.
  • Custom URL Parameters: The Form Controller defaults to use required URL parameters to get its Table and SysId. Users are notified if this action will modify the URL structure for the page. If desired, users can choose to configure this manually by hardcoding the Table and SysId.
 
Context Awareness of Presets
Presets are context-aware, meaning they adapt to the components present on the page. For instance, if you add a form to the page after configuring the heading component with the preset, the form will automatically adjust to display the appropriate record form using the controller's data. Similarly, if you add an Action Bar component, it will automatically configure itself to display the relevant actions for the record.
 
Advanced Features with Xanadu
With the Xanadu release, presets can now also configure controllers, expanding their functionality. More complex components may bundle additional components onto the page, such as viewport modals and popovers for displaying reference field content.
 
 
Upgradeability of Presets
Presets are upgradeable just like controllers and components. When a preset receives an upgrade, any components or controllers utilizing that preset will automatically benefit from the changes. However, presets also offer the capability of overrides.
  • Override Functionality: If a user wants to modify a specific configuration (e.g., changing the heading text style), they can do so by overriding just that property instead of removing the preset entirely.
  • Maintaining Upgrades: By overriding a single configuration property, users retain the advantages of the preset's upgrades for other properties while maintaining their custom changes. The preset continues to control all other properties, ensuring that users continue to receive updates and enhancements without losing their specific configurations.
  • Storage of Overrides: Overrides are stored within the macroponent record being edited, meaning users can only override settings for pages they have edit access to.
The integration of upgradability, presets, controllers, and components within ServiceNow's UI Builder ensures that applications remain dynamic, maintainable, and user-friendly. This architecture allows developers to focus on delivering value without worrying about the complexities of manual updates or breaking changes, thereby facilitating a more efficient development process.

 

Conclusion

We hope this video and article provided an in-depth look at ServiceNow's approach to modernizing its web platform, including the use of UI Builder, the Next Experience UI framework, and the importance of metadata in creating low-code, flexible applications. Chris Johnson, the director of design on the web platform team, shared valuable insights into the evolution of ServiceNow's UI, the benefits of web components, and the significance of controllers and presets in ensuring upgradability and efficiency.

 

We hope this video has answered many of your questions and provided a clear understanding of the tools and capabilities available to you. If you have any further questions or topics you'd like us to explore in future videos, please post them in the comments section below. Your feedback is invaluable in helping us improve and deliver content that meets your needs.

 

Check out the Next Experience Center of Excellence for more resources

Comments
aneta_koleva_sn
ServiceNow Employee
ServiceNow Employee

Great content! Thank you for wrapping it up on one place 🙂

Edward Brown
Tera Contributor

How do we move dashboards built in UI Builder from one environment to another?  

 

Update sets?  XML? Is there an easy way to capture everything built in a page/variant and move it all at once?

Ridwan Azeez
Tera Contributor

Great content. Thank you for providing a readable content for some of us who find watching a video exhausting

Mitul Jain
Tera Contributor

Awesome understandable content. 

John Kelly1
Tera Expert

Thank you so much. A succint and a very well thought out overview of a complex topic.

sabra_gr
Tera Contributor

"Thank you for this detailed and informative content! I have a question: Can we use custom-developed components created with the Now Experience Framework in a Portal App Shell page? Specifically, are they reusable across both Workspaces and Portal App Shell experiences? Looking forward to your insights!"

pkchrisjohnson
ServiceNow Employee
ServiceNow Employee

In response to the question from @sabra_gr about whether custom components can work in the Next Experience Portal App Shell (not, Angular Portals, those are different) the answer is in almost all cases that yes, the components will work anywhere.

 

Now, here is the caveat. If a custom component is designed to work with a specific piece of data or event that is provided by ONLY a specific App Shell, that component wouldn't work in another context that lacks the data or events. But ServiceNow doesn't ship components that work in this manner, and I would argue that this is a best practice. The data and events that are provided by the various app shells in UIB are quite similar, with most of the differences related to how you navigate inside of them (e.g. the tabs app shell has events around tabs whereas the breadcrumb doesn't because it doesn't have tabs). 

You can read more about the different app shells here.

EdwardNunez
Tera Explorer

Good wealth of knowledge in one article, thank you!

sabra_gr
Tera Contributor

@pkchrisjohnson Thank you for your answer! 

Beyonslay
Tera Contributor

This is really very informative, thank you.

 

 

 

192.168.100.1 192.168.1.1

emines
Tera Contributor

Great content!👨‍💻

durgapmittal
Tera Explorer

Very informative, thanks for such a great video, easy to follow and also fun to watch !

juancarrion
Tera Contributor

Amazing Content!

bvlo
Tera Expert

This video should be a template for conveying information on complex topics.  Chris, you explained this material in a way that, as a developer, completely made sense to me. You followed up with some relatable examples. You also anticipated many follow-up questions someone new to UI Builder would surely have when explaining a new concept. Bravo

Version history
Last update:
‎11-22-2024 11:08 AM
Updated by: