Loading

Navigating by URL

From ServiceNow Wiki
Home > Use > Standard User Interface Introduction > Navigation > Navigating by URL (Redirected from Tiny URL Support)
Jump to: navigation, search
Navigation and User Interface
Related Topics

Contents

1 Overview

Users can navigate to a record or module directly by using a URL. This article explains the URL schema by which the system generates pages.

2 URL Schema

The basic schema for a system URL is:

https://<base URL>/nav_to.do?uri=<page name>.do?sys_id=<sys_id>%26<page parameters>

2.1 Elements

The URL schema consists of the following elements:

  • base URL: unique, secure Web address for each instance. The default format is: https://<instancename>.service-now.com.
    Customers who want to display a custom base URL in email notifications can set the glide.email.override.url property.
  • nav_to.do?uri= (optional): loads the page in the standard interface, with the banner frame on top and the application navigator on the left.
  • <page name>.do?: where the page name is the form, list, UI page, or other page to open. To view a list, use <table name>_list.do.
  • sys_id=<sys_id> (optional): where <sys_id> is the sys_id of the record to open in form view. To create a new record, specify a sys_id of -1.
  • <page parameters> (optional): may specify a query, view, redirection page, and more. Sample parameters are:
    • sysparm_view=ess: specifies a view (ess).
    • sysparm_query=number=INC00040: specifies a query (number is INC00040).
    • sysparm_query=priority=2^active=true: specifies a complex query with two terms (priority is 2 and active is true).
    • sysparm_query=priority=2^active=true^EQ^GROUPBYcategory: groups query results (by category).
    • sysparm_order=number" specifies the field by which to sort (number).
    • sysparm_order_direction=desc: specifies a sort order (descending).
    • sysparm_force_row_count=5: limits the maximum number of results (5 records).
    • sysparm_result_view=viewname: specifies the view for search results.
  • %26CSV: specifies a file format, can be CSV, XML, PDF, or UNL (Unload).
  • %26: ASCII-encoded ampersand (&); separates page parameters.
  • ^ (carat): builds multiple term queries or specifies multiple field values.

2.2 Forms Versus Lists (sysparm_query)

The sysparm_query page parameter behaves differently for a list versus a form.

  • List: returns records that match the query conditions.
  • Form (with sys_id=-1 specified): applies the values to the new record.

3 Long URLs

The default URLs by which the system renders pages may exceed the character limit of Microsoft Internet Explorer, resulting in an error message. To prevent this error, enable tiny URL support, which generates shortened internal URLs that fall within the character limit.

The Tiny URL Support plugin is activated automatically but is not enabled. Activate this plugin if Microsoft Internet Explorer displays failure to open page errors during routine operations in the ServiceNow platform.

3.1 Tiny URL Support Properties

The following system properties (System Properties > System) control tiny URL generation.

Note
Note: The system does not convert all URLs to tiny URLs. Only some URLs the system generates as redirects are converted. For example, a URL the browser generates when a user opens a record is not converted to a tiny URL.
Property Description
glide.use_tiny_urls When enabled, converts URLs too large for Internet Explorer to tiny URLs.
  • Type: true | false
  • Default value: false
glide.tiny_url_min_length Minimum length of a redirect URL that is turned into a tiny URL
  • Type: integer
  • Default value: 1024

4 Examples

4.1 Open a Form with Preset Values

This example opens a new Incident form in the standard interface with a priority of 1 and an incident state of Awaiting Problem.

Schema:

https://<baseURL>/nav_to.do?uri=<table name>.do?sys_id=-1%26sysparm_query=<field=value>

Example:

https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=priority=1^incident_state=3

You can also use JavaScript to access GlideSystem methods. The following creates the same type of incident as above, and also populates the caller ID with the current user ID:

https://<instance name>.service-now.com/nav_to.do?uri=incident.do?sys_id=-1%26sysparm_query=priority=1^incident_state=3^caller_id=javascript:gs.getUserID()

4.2 View a List of Incidents

These examples open a list of all incidents with (example 1) and without (example 2) the navigation frame.

Schema:

https://<baseURL>/nav_to.do?uri=<table name>_list.do

Example 1:

https://<instance name>.service-now.com/nav_to.do?uri=incident_list.do

Schema:

https://<baseURL>/<table name>_list.do

Example 2:

https://<instance name>.service-now.com/incident_list.do

4.3 View a List of Attachments

This example opens the Attachments table in list view.

Schema:

https://<baseURL>/nav_to.do?uri=<table name>_list.do

Example:

https://<instance name>.service-now.com/sys_attachment_list.do

4.4 View a Filtered List

This example returns a list of active incidents with high escalation in the standard interface.

Schema:

https://<baseURL>/nav_to.do?uri=<table name>_list.do?sysparm_query=<field=value>

Example:

https://<instance name>.service-now.com/nav_to.do?uri=incident_list.do?sysparm_query=active=true^escalation=2

4.5 Return a File

This example returns a comma-separated value file of records in the Incident table that meet the query conditions.

Schema:

https://<baseURL>/nav_to.do?uri=<table name>_list.do?sysparm_<sysparmTypeOrField=value>%26CSV

Example:

https://<instance name>.service-now.com/nav_to.do?uri=incident_list.do?sysparm_query=active=false%26CSV


Was this article helpful?
Yes, I found what I needed
No, I need more assistance
Views
Personal tools