---
sourceDocument: Brazil Build or modify applications
sourceDocumentLink: https://www.servicenow.com/docs/r/application-development

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Build or modify applications

ft:clusterId :

    - cadev

bundleId :

    - cadev

workflow :

    - Development, Data, and Analytics


---

# Widget editor

# Widget editor {#ariaid-title1}

Release version: Brazil  
Updated October 1, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) 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 Widget editor

The Widget Editor is a three-panel workspace in ServiceNow's Widget Builder designed for creating and previewing widgets efficiently.
It includes code editors for widget components and server scripts, a live preview pane, and a property panel to manage widget metadata and input properties.
This environment supports iterative development with immediate visual feedback.
Show full answer Show less  

## Key Features

* **Component and Script Tabs:** These are dedicated code editors with syntax highlighting and autocomplete for widget component code (`index.js`) and the server script (`server.js`). Server scripts use an export default function pattern and support GlideRecordSecure and GlideQuery for secure database operations respecting ACLs. Server functions can be invoked from the component using methods like `this.server.get()`, `.update()`, or `.refresh()`.
* **Handling Complex Widgets:** For widgets that import additional utility files beyond the component and server scripts, the Widget Editor does not display these files. Customers should use the Lux Lab VS Code extension to edit complex widgets fully.
* **Preview Tab:** Provides a live, resizable, and zoomable viewport to see the widget in action. Users can resize the preview pane, zoom in and out with controls or keyboard shortcuts, and refresh the preview to reflect the latest build. Errors such as missing dependencies or import failures are clearly indicated with retry options. Widgets not yet built display a prompt to build.
* **Property Panel:** Offers two modes---
  * **Widget Properties:** Manage widget metadata including name, ID, description, and category.
  * **Preview Props:** Inject different input property values into the live preview to test widget behavior without altering saved defaults.
* **Save, Build, and Publish Workflow:**
  * **Save:** Stores work in progress.
  * **Build:** Compiles the widget and updates the preview immediately, enabling quick iteration. Build errors are preserved as drafts with error messages for troubleshooting.
  * **Publish:** Builds and deploys the widget to the instance. The first publish confirms creation and deployment; subsequent publishes confirm updates. Publishing errors after a successful build are displayed to guide resolution.

## Practical Benefits for ServiceNow Customers

This widget editor empowers customers to rapidly develop, preview, and refine custom widgets with a streamlined interface that integrates coding, live feedback, and property management. By supporting secure database queries and offering detailed build and error feedback, it helps ensure robust, compliant widget development. For complex widgets requiring multi-file edits, integration with the Lux Lab VS Code extension enables comprehensive development. The preview and property injection features allow testing different scenarios without impacting saved configurations, promoting efficient and safe design iterations.  
The widget editor is a three-panel workspace for building and previewing a widget. It has a code editor for the component and server script, a live preview, and a panel for widget properties.

## Component and Script tabs {#widget-editor__widget-editor-component-and-script-tabs}

Both tabs are code editors with syntax highlighting and autocomplete for the widget component code and its server script. The server script is written as `export default function server(data, options, input) {...}`, with `GlideRecordSecure`, `GlideQuery`, and `gs` available --- use `GlideRecordSecure` rather than `GlideRecord` so queries respect ACLs. Call `this.server.get(input)`, `.update()`, or `.refresh()` from the component to run it.
Figure 1. Component tab with syntax highlighting and autocomplete

## Complex widgets with additional files {#widget-editor__widget-editor-complex-widgets-with-additional-files}

Widget Builder only edits the widget's component (index.js) and server script (server.js). A complex widget that has relative imports to other utility files isn't fully editable here,
those additional files aren't shown in the Component or Script tabs.  
Important:  
If a widget imports from files other than its own component and server script, use the [Lux Lab VS Code extension](https://marketplace.visualstudio.com/items?itemName=ServiceNow.now-vscode-extension-ainpx-lab) instead.
Figure 2. Complex widget with additional utility files, opened in the Lux Lab VS Code extension

## Preview tab {#widget-editor__widget-editor-preview-tab}

The Preview tab renders the widget live, in a resizable and zoomable viewport:

* Drag the handles on the left, right, bottom, or corner to resize the preview.
* Use the zoom controls in the bottom-right corner, or hold Ctrl/Cmd and scroll, to zoom in and out. The zoom controls reflow the layout rather than just scaling it visually.
* Select Refresh to reload the preview from the latest build, bypassing the short cache Widget Builder keeps when you switch tabs.

If the preview can't load, it shows the specific problem, such as a missing dependency, a timeout, an import failure, or a registration error with a Retry button. A widget that hasn't been built yet
shows "Preview not available yet --- Click Build to compile" instead of an error.
Figure 3. Preview tab with resize handles and zoom controls

## Property panel {#widget-editor__widget-editor-property-panel}

The property panel on the right has two modes:

Widget Properties
:   A form for the widget's metadata: name, ID, description, category, and similar fields.

Preview Props
:   Inject property values into the running preview to see how the widget behaves with different inputs, without changing the widget's saved defaults.
Figure 4. Property panel in Widget Properties mode Figure 5. Property panel in Preview Props mode

## Save, Publish, and Build {#widget-editor__widget-editor-save-publish-and-build}

Save
:   Builds the widget without deploying it. The preview updates right away, so you can iterate quickly. If a build fails, your edits aren't lost --- Widget Builder saves a draft and shows the build error. Fix the issue and
    save or publish again.

Publish
:   Builds and deploys the widget to the instance. A new or cloned widget's first publish shows "Widget created and published"; later publishes show "Widget published". If publishing fails after a successful build,
    Widget Builder shows the error.

