Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Modify the page associated with a scripted list menu item in Service Portal - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Modify the page associated with a scripted list menu item in Service Portal
KB0657736

Modify the page associated with a scripted list menu item in Service Portal


4276 Views Last updated : Jun 20, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

Scripted list menu items, which are meant to be dynamic, are not honoring the Page field in the menu items. 

Resolution

To resolve this, you can add a __page object while generating your list.

 

Add page object to scripted list

The following example demonstrates how to modify this functionality in an default Request Menu Item: 

  1. Navigate to https://yourInstance.service-now.com/sp_rectangle_menu_item.do?sys_id=7c686d00d7200200a9ad1e173e24d4e9
  2. Part of the default script populating the incident items using Glide Record query in addition the page object __page
    var z = new GlideRecord('incident');
    z.addActiveQuery();
    z.addQuery('caller_id', gs.getUserID());
    z.orderByDesc('sys_updated_on');
    z.setLimit(max);
    z.query();
    while (z.next()) {
    var a = {};
    $sp.getRecordValues(a, z, 'short_description,sys_id,number,sys_updated_on');
    if (z.short_description.nil())
    a.short_description = "(No description)";
    a.__table = z.getTableName();
    a.type = 'record';
    a.__page = 'form'; // __page should be string value of the page ID you would like to redirect
    a.sortOrder = z.sys_updated_on.getGlideObject().getNumericValue();
    t.items.push(a);
    }

Note: For this to work, the type of the menu item should always be set record.

Additional information

The HTML code is used to display a drop-down tree menu, specifically in the header Menu Widget, using an Angular template, spDropdownTreeTemplate.

Get the Angular template: https://yourInstance.service-now.com/sp_ng_template.do?sys_id=492127b05b301200e39fc7ad31f91a50

 

 


The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.