Custom Component Builder

  • Release version: Washingtondc
  • Updated February 1, 2024
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of Custom Component Builder

    The Custom Component Builder allows you to develop reusable components using the Next Experience UI Framework and the ui-component extension. These components enhance the user interface by providing customizable building blocks that can be integrated into your applications, improving user experience and efficiency.

    Show full answer Show less

    Key Features

    • Personalization: Tailor the user interface to meet the specific needs of agents, customers, and the organization.
    • Reusable Components: Create components that can be utilized across various applications, reducing redundancy.
    • Integration with APIs: Use APIs to consolidate data, accommodating unique omni-channel environments.
    • Local Development: Set up a local environment to create, test, and deploy components efficiently.
    • Application Scope: Define a namespace identifier for your components to prevent conflicts in applications.

    Key Outcomes

    By leveraging the Custom Component Builder, you can enhance your ServiceNow applications with tailored components that improve accessibility to crucial data, streamline workflows, and support the specific requirements of your organization. This results in more effective employees and a more responsive service delivery system.

    Develop custom components using the Next Experience UI Framework and the ui-component extension.

    Components are reusable building blocks that you use to create a custom user interface. The Next Experience Design System comes with a set of customizable components that you can drag into your custom UI. Develop your own components if you can't find what you need in the Next Experience Design System library.

    To see the Next Experience Design System library, visit the ServiceNow® Developer Site.

    Benefits of creating custom components

    Developing custom components lets you:

    • Personalize a UI according to your agent, customer, and company needs.
    • Make your employees more effective and reduce context switching with quick access to important data and information.
    • Accommodate your company's unique omni-channel environment using APIs to consolidate your data.

    For example, you might want to create a component that displays the cases associated with an SLA, or that tracks the active chats in a particular queue. You can use the Next Experience UI Framework and the ui-component extension to develop the component you need, and access data from your platform using the Http Effect API. You can also query platform data using GraphQL by creating a custom schema. For more information, see Scripted GraphQL.

    What to know before you begin

    Before you start designing and building your component, make sure you have:

    • Some general knowledge of web component concepts, development, and design.
    • JavaScript knowledge to define the component behavior.
    • Knowledge of Node Package Manager (npm).
    • The most recent version of Node.js installed on your local machine. For more information, see, Node.js.
    • The ServiceNow CLI installed on your machine.

    Next Experience UI Framework

    The Next Experience UI Framework is a JavaScript framework that lets you extend your apps and build web components that are reusable throughout your applications. Using the Next Experience UI Framework lets you:

    • Create a single component to use in multiple places across your applications.
    • Encapsulate the component's scope to prevent conflicts with other code.
    • Add properties, slots, and actions to your component, allowing users to customize the component every time they use it in a Workspace.

    For more information, see the ServiceNow® Developer Site.

    ui-component extension and development flow

    The ui-component extension is an extension to the ServiceNow CLI that lets you develop custom components using the Next Experience UI Framework. With the ui-component extension, you can:

    • Create the set of files required to develop a component, or project scaffolding.
    • Start a local development server to test your component.
    • Build a component project and deploy it to a ServiceNow instance.

    Application scope

    When you deploy a Next Experience UI Framework component, it deploys into a scoped application on the instance. You can provide an application scope for the component to use as a namespace identifier. Use the namespace identifier guidelines for application development on the instance. For more information, see Application scope.

    When reserving an application scope, follow these requirements:

    • Maximum: 18 characters.

    • Case: snake case.

    • Format: x_customerprefix_componentname, where:
      • customerprefix is the value in the glide.appcreator.company.code system property on your instance.
      • componentname is the value provided in the component's name parameter when you created the project.

    If you do not provide an application scope when creating your component project, the Now CLI creates one for you.

    Alternatively, you can add a value to the scopeName parameter in the now-ui.json file. For more information, see Change a component's application scope.

    Reference guide

    To see the Now CLI reference guide, visit the Developer Site.