Verify the functionality of menus and modules in the application navigator.

Application Menu Visibility

Verifies the visibility, or lack thereof, of selected application menus in the application navigator (left navigation bar). For example, you create a test that first impersonates a user, then verifies that specified application menus (such as Self-Service and Reports) are visible, or are not visible, to that user.

Create an application menu

Application menus define the main content that users can access in the application navigator. You can configure which applications appear in the application navigator.

Before you begin

Role required: admin

About this task

When creating an application menu, consider grouping like modules into a consolidated application menu. When editing an existing menu, add more useful modules to the application menu, and remove unneeded ones.

Procedure

  1. Navigate to All > System Definition > Application Menus.
  2. Click New.
  3. Complete the form.
    Field Description
    Title Defines the display name of the application menu.
    Roles Restricts access to the specified roles. All users can view the application menu when it is active.
    Category Specifies the menu category that defines the navigation menu style (default value is Custom Applications).
    Hint Defines the text that appears in a tooltip when a user points to this application menu.
    Active Select the check box to activate the application menu. Only active application menus appear in the application navigator.
    Description Provide a more detailed explanation of what this application does.
    Other fields
    Order Defines the relative position of the application menu in the application navigator. If you do not specify an order, the default order of the menu category is used.
    Default device type This field is not used. You can define application menus for mobile devices in a separate table.
    Note: You may need to configure the form to see all fields.
  4. Click Submit.
  5. Create modules to appear in the application menu.
    Only application menus that contain modules appear in the application navigator.

Create a module

Modules are the children, or the second tier navigation options to the applications in the application navigator. Modules often link to other pages or records in the platform. You can configure which modules appear in the application navigator using Application Menus module.

Watch this five-minute video to learn about adding application menus and modules to the application navigator.

Before you begin

Role required: admin

Procedure

  1. Open the application menu record using one of the following methods.
    • Navigate to System Definition > Application Menus and select the application menu from the list.
    • Point to the application menu and click the edit application (pencil) icon.
    Figure 1. Two methods for creating a module
    Gif showing the first and second methods for creating a module
  2. Scroll down to the Modules related list and click New.
  3. Define the module by completing the fields on the Module form.
  4. On the Visibility tab, complete the fields.
    Table 3. Visibility tab
    Field Description
    Roles Restricts module access to the specified roles. If this field is left blank, the module is visible to all users who have access to the application menu.
    Active Defines whether the module appears in the application navigator.
    Override application menu roles Allows users to access this module even if they do not have permission to view the containing application menu. Users must still meet the role requirements for this module.
  5. On the List Type tab, complete the fields.

    The fields displayed depend on the Link type you choose. All module URIs must be encoded. If you supply arguments to the module URI, either you or ServiceNow. For more information about encoding module URIs, see Encoding module URIs.

Module link types

The Link type field on the Module form specifies what type of link the module opens.

Encoding module URIs

Clicking a module name in the navigation pane executes a URI that opens the module's page in the content pane. All the characters in module URIs must be URL-encoded or the link breaks.

Note: If you're upgrading to the New York release or later from a pre-New-York release, your module UIs may break if they do not follow the conventions presented in this topic.

When you create modules, you have the option of adding arguments and filter conditions that sort and/or reduce the number of results displayed in the content pane. When you click a module name in System Definitions > Application Definitions, you can see those conditions and arguments on the Link Type tab.

Link type tab

The argument definition in Arguments and filter conditions defined in Filter become part of the module's URI and must be URL-encoded. ServiceNow automatically URL-encodes filter conditions and appends them to the module URI using sysparm_query. For example, adding the filter condition, Active is true appends sysparm_query=active%3Dtrue to the module's URI; %3D is the URL-encoding for the equals sign (=).

The following table shows when you must URL-encode the argument in the Arguments field and when ServiceNow URL-encodes the argument.

You can turn on (the default) and off the URL-encoding requirement for module UIs using the glide.ui.encode_module_uri property.

Examples

The following examples demonstrate when you have to URL-encode the argument definition in Arguments:
  • There are no filter conditions and the argument definition in Arguments starts with an ampersand, for example,&sysparm_fixed_query=assigned_to=javascript:gs.user_id().

    This argument breaks the module URI because the equals sign and the colon are not URL-encoded, and the ampersand prevents ServiceNow from URL-encoding the argument. URL-encode the argument: &sysparm_fixed_query=assigned_to%3Djavascript%3Ags.user_id().

  • There are filter conditions and the argument definition in Arguments does not start with a caret (^), for example, sysparm_name=Barnes & Noble's.

    This argument breaks the module URI because the ampersand and spaces are not URL-encoded. URL-encode the argument: sysparm_name=Barnes%20%26%20Nobel's

Module Visibility

Verify the visibility, or lack thereof, of selected modules in the application navigator (left navigation bar). For example, create a test that first impersonates a user, then verifies that specified modules (such as Homepage and My Requests) are visible, or are not visible, to that user.

Navigate to Module

Open a module from the application navigator, as if a user had clicked it. The module must be visible to the currently executing user to navigate to it.

Note: Not all pages are currently testable. Wherever the module takes you is your responsibility.