When creating a new widget, create new or clone widget, the identification and replacement of the invalid characters in the ID field of the widget is different between Service Portal and the standard UI.

  • In the Service Portal widget editor, the ID field replaces all invalid characters that are not A-Z, 0-9, underscore or hyphen with an underscore
  • In the standard UI, the ID field is updated on the change of the field to replace all invalid characters that are not A-Z or 0-9 with a hyphen

Steps to Reproduce

  1. Service Portal
    1. In the Service Portal Widget Editor, add a new widget or clone a widget.
    2. In the Add a Widget or Clone Widget dialog, enter some text in the Name field that includes spaces.
    3. The ID field is automatically populated, and all spaces are replaced with underscores.
    4. The ID value can be modified to include a hyphen.
  2. Standard UI
    1. In the List view for the sp_widget table, create a new widget, or clone an existing widget.
    2. In the new widget form, enter text in the ID field that includes spaces.
    3. The ID field is updated after the change is made, upon selecting a different field, and replaces all spaces with hyphens.
    4. Modify the ID field to add an underscore, the ID is updated on change to replace underscores with hyphens.

The standard UI only allows letters A-Z and numbers 0-9 as valid values, and all other characters are replaced with hyphen.


The Service Portal is inconsistent with the standard UI due to the Client Script Ensure Valid Widget ID.

The script includes the line:

var fixedValue = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, "-");

To make the standard UI behave the same as the Service Portal, use the following:

var fixedValue = s.toLowerCase().replace(/[^a-zA-Z0-9-_]/g, "_");

Related Problem: PRB1201227

Seen In

There is no data to report.

Fixed In


Associated Community Threads

There is no data to report.

Article Information

Last Updated:2020-11-15 09:43:16