Widget diagnostics
Summarize
Summary of Widget Diagnostics
Widget Diagnostics in ServiceNow's Service Portal enables you to resolve page issues by identifying widget customization levels and inspecting widget code directly from the portal page. This tool helps diagnose widget-related problems, which are a common cause of unexpected portal behavior.
Show less
Customization Levels
Widgets are categorized into four customization levels, which indicate how they have been modified:
- Base system: Original system widgets without code changes.
- Cloned: Widgets cloned from base system widgets.
- New: Newly created widgets.
- Customized: Base system widgets altered via code, options, dependencies, templates, or Angular Providers.
Identifying these levels is essential to prioritize troubleshooting efforts. Widgets are color-coded in the Widget Context Menu for quick recognition.
Checking Widget Code
You can inspect widget code directly from the portal page by selecting the information icon on any widget. The diagnostics window allows you to:
- View the widget record and identify potential code issues without leaving the portal page.
- Access related records such as widget dependencies, Angular Providers, and ng-templates used by the widget.
- Compare recent code changes in Angular Providers or ng-templates with previous versions to detect problematic updates.
- Compare recent changes in customized widgets against their prior versions.
- Compare customized widgets against their base system versions to identify and potentially revert customizations.
Recommendations for Diagnosing Widgets
Customized widgets pose the highest risk for portal issues, especially during system upgrades, since they are unsupported in upgrades. To resolve issues:
- Identify customized parts of the widget code and revert them to the original configuration.
- Consider reverting customized widgets proactively to avoid upgrade problems.
- If issues persist, review new and cloned widgets. Debug new widgets by comparing recent changes, and reclone cloned widgets post-upgrade to incorporate updated base system code.
- Base system widgets are least likely to cause issues; if suspected, remove and re-add them without options or try adding them on a different page.
Limitations
- Widget Diagnostics allows viewing and comparing code but does not support direct code fixes or reverts; you must navigate away from the portal to edit code.
- The tool disables when navigating between portal pages.
- Color coding may not be accessible for visually impaired users.
- Only first-level widget dependencies are shown; deeper nested dependencies require checking the widget record.
- Deleted widget dependencies cannot be tracked.
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.
- Identifying widget customization levels
- Checking the code that is used in each widget
Identifying customization levels
| Customization level | Description |
|---|---|
| Base system | Base system widget with no modifications, including widgets for which you have set instance options. |
| Cloned | Widget that you cloned from a base system widget. |
| New | Widget that you created. |
| Customized | Base system widget that you configured in any of the following ways:
|
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:
|
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 () on a widget.
- View a widget record from a portal page
View and identify potentially problematic code in the widget record without navigating away from the portal page.
- View related records
View and identify potentially problematic code in the widget dependencies, Angular Providers, and ng-templates that are being used by the widget.
- Compare changes to related records
Compare an Angular Provider or ng-template against its previous version so that you check if your most recent code changes are causing issues on a portal page.
- Compare changes to a customized widget
Compare your most recent update of a customized widget against the previous version to check if your recent changes are causing issues on a portal page.
- Compare a customized widget against the base system
Identify customizations to a base system widget so that you can revert your customized widgets and resolve issues on a portal page.
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 customized widget against the base system.
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 changes to related records.
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 system widget. In this case, it's recommended that you clone the widget again and add your customizations to the clone.
A base system widget is least likely to cause page issues. If you've already checked other widgets and are still experiencing page issues, remove base system widgets from the page and add them again without any widget options set. You can also try adding base system widgets to another page instead.
Limitations
- 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.