UI page access

Each UI page has a URL computed from the application scope, page name, and the .do file extension.

For example, to display the page called glidewindow_example on the demo system, you would navigate to https://<instance name>.service-now.com/glidewindow_example.do. If the page was part of a custom application called example_app, you would instead navigate to https://<instance name>.service-now.com/x_example_app_glidewindow_example.do.

You can also add additional parameters to a URL that can be accessed within a page's HTML section as jelly variables. That is, appending arguments to the URL as follows: /my_test_page.do?sysparm_verbose=true creates jelly variables called verbose that can be accessed as follows:
<j2:if test="$[!empty(sysparm_verbose)]"> <span>show extra stuff </span> </j2:if >

A common practical example of this might be retrieving a database record for display. To build a list of a user's roles, pass in a parameter with the user's sys_id. Invoke the following UI page to display a list of roles for that user with Jelly code:

role_select.do?sysparm_user=5137153cc611227c000bbd1bd8cd2007
<j:set var = "jvar_user_id" value = "${sysparm_user}" />
 
  <g:evaluate> var userRoles = new GlideRecord('sys_user_has_role');
    userRoles.addQuery('user','${jvar_user_id}');
    userRoles.query(); 
  </g:evaluate>
 
  <select id='select_role'> 
     <j:while test = "${userRoles.next()}"> 
        <option value = "${userRoles.sys_id}"> ${userRoles.role.name} </option> 
     </j:while> 
  </select>

An exception to be careful of, though, is the reserved variable name sys_id. This variable always contains the ID of the UI page itself, regardless of what is specified in the URL. A common substitute variable name is sysparm_id.