Widget diagnostics

  • Release version: Yokohama
  • Updated January 30, 2025
  • 4 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 Widget diagnostics

    Widget diagnostics in ServiceNow Yokohama release helps you resolve Service Portal page issues by identifying widget customization levels and inspecting widget code directly from the portal page. This tool is essential for diagnosing problems caused by bugs or modifications in widget code, enabling you to quickly pinpoint problematic areas on your portal pages.

    Show full answer Show less

    Widget Customization Levels

    Understanding widget customization levels allows you to focus on the most critical parts of widget code when troubleshooting. The four customization levels are:

    • Base: Original widgets installed with the system or plugins, unmodified but may have instance options set.
    • Cloned: Widgets cloned from base widgets.
    • New: Widgets created from scratch.
    • Customized: Base widgets modified directly or configured via option schema, dependencies, ng-templates, or Angular Providers.

    Widgets are color-coded on the portal page for easy identification: green (base), yellow (cloned), blue (new), and red (customized).

    Checking Widget Code

    You can view widget code from the portal by clicking the information icon on a widget. The diagnostics window lets you:

    • View widget records and identify problematic code without leaving the portal.
    • Examine customizations in widget dependencies, Angular Providers, and ng-templates.
    • Compare current versions of Angular Providers, ng-templates, or widgets against previous versions to identify recent changes causing issues.
    • Compare cloned or customized widgets with base widgets to identify and revert customizations if needed.

    Recommendations for Diagnosing Widgets

    • Prioritize customized widgets: These are the most likely source of issues and are not supported during system upgrades. Revert customized widgets to their original code to prevent or resolve problems, especially during upgrades.
    • Check new and cloned widgets: Recent code changes in new widgets may cause issues; use version comparisons to identify problematic changes. For cloned widgets, recloning after upgrades is recommended to ensure they include updated base code.
    • Base widgets: Least likely to cause issues. If problems persist, try removing and re-adding base widgets without options or adding them to a different page.

    Limitations

    • You cannot edit or revert widget code directly from the diagnostics tool; changes require navigating away from the portal page.
    • The tool disables if you navigate to another portal page during diagnostics.
    • Color-coded widget identification may not be accessible for visually impaired users.
    • Only first-level widget dependencies are shown; nested dependencies require manual inspection in the widget record.
    • Deleted widget dependencies cannot be tracked by the system.

    Resolve Service Portal page issues by identifying widget customization levels and checking widget code directly from a portal page.

    If a portal page isn't working as expected, it may be because of a bug in widget code. To diagnose the page, try diagnosing the widgets on the page.

    Diagnosing widgets involves:
    • Identifying widget customization levels
    • Checking the code that is used in each widget

    Identifying customization levels

    Customization levels describe how widgets have been modified or developed. Identifying the customization level of a widget can help you know which part of the widget code is most important to check. There are four levels of widget customization.
    Customization level Description
    Base Base widget installed on a base system or with other ServiceNow plugins. Base widgets have no modifications but can have widget instances for which you have set instance options.
    Cloned Widget that you cloned from a base widget.
    New Widget that you created.
    Customized Base widget that you configured in any of the following ways:
    • Modified the widget code directly
    • Modified widget option schema
    • Modified widget dependencies, ng-templates, or Angular Providers

    To identify the customization levels of widgets on a portal page, open the Widget Context Menu and select Show Widget Customizations. Widgets are color-coded as follows:

    • Green: base widget
    • Yellow: cloned widget
    • Blue: new widget
    • Red: customized widget
    Figure 1. Widget customizations highlighted on a portal page
    Identifying customization levels

    Checking the widget code

    After you've identified the customization levels of widgets on a portal page, check the code in each widget.

    To view the widget code from the portal page, click the information icon (Information icon) on a widget.

    Widget diagnostics window

    From the widget diagnostics window, you can check the widget code in several ways:

    Recommendations for diagnosing widgets

    Of the four customization levels, the highest priority issue is customized widgets. These widgets aren't supported in system upgrades. If you're experiencing page issues during an upgrade, it may be because you have a customized widget on your portal page.

    To resolve page issues that may be caused by customized widgets, identify which parts of the widget code have been customized. Then revert the code to the original configuration. For more information on identifying these code differences, see Compare a cloned or customized widget against a base widget.

    Tip:
    Even if a customized widget is not causing page issues now, you may want to revert to the original widget to prevent issues during upgrades later.

    If you're still experiencing page issues after reverting customized widgets, check your new and cloned widgets next.

    With a new widget, it's likely that your most recent code changes are causing issues on your portal page. To identify your most recent changes so that you can debug your code, follow the steps in Compare versions of a widget related record.

    If you cloned a widget prior to a system upgrade, it's likely that the cloned widget didn't receive the same updated code as the base widget. In this case, it's recommended that you clone the widget again and add your customizations to the clone.

    A base widget is least likely to cause page issues. If you've already checked other widgets and are still experiencing page issues, remove base widgets from the page and add them again without any widget options set. You can also try adding base widgets to another page instead.

    Limitations

    There are several known limitations using widget diagnostics from a portal page:
    • Although you can view and compare widget code, you can't fix or revert code directly. Navigate away from the portal to change the code.
    • If you navigate to another portal page while using widget diagnostics, the system disables the tool.
    • Because the tool uses color to categorize widgets, it may not be accessible for visually impaired users.
    • The widget dependencies that are listed on the portal page reflect only the first-level dependencies. Any dependency that is nested deeper than the first level is not included. To further troubleshoot the widget, check the nested dependencies in the widget record.
    • There is no way for the system to track a Widget Dependency after you've deleted it.