OBLYTECH Logo
OBLYTECH Logo

Using List Column and Record Context Menus in ServiceNow

ServiceNow context menus open from the list title, column heading, field value, or form header. Use the column menu to sort, group, or export records, the field menu to filter by a value, and the form menu to save, copy record details, change views, or inspect record history.

Where each context menu lives

Four menus cover the day-to-day work.

  • List title menu: Right-click the list title. Records per page, grouping.
  • Column heading menu: Right-click a column name. Sorting, grouping, exporting.
  • List field menu: Right-click a value in a row. Quick filters on that value.
  • Form context menu: Click the icon beside the form title. Saving, inserting, exporting, viewing XML and history.

Some entries in these menus depend on the role you hold, the applications installed on the instance, and the UI version. These steps describe Core UI; check the controls on your instance and release. Two people looking at the same list can therefore see different menus.

Column heading menu: sorting

Click a column name to sort in ascending order, then click again to reverse it. Sorting needs no role. The column menu also offers Sort (a to z) and Sort (z to a). An arrow identifies the primary sort direction; a downward arrow means descending. Choice fields sort by their underlying values rather than their displayed labels, which can explain an order that does not look alphabetical.

Column heading menu: grouping

The same column menu carries Group By. Grouping aggregates the list on one field, creates one group for each value of that field, and shows a record count beside each group name. No role is needed to group a list.

To group from the title bar instead, open the title menu, choose Group By and pick the field. To remove grouping, choose — None — in that title bar menu, or right-click the grouped column and select Ungroup.

Use these controls to inspect a grouped list:

  • Click the arrow next to a group name to expand or collapse that group.
  • Click the arrow at the top of the list to expand or collapse all groups.
  • Click the group name to open the full list for that group.

Each group shows up to the number of records set per page. To see every record in a group, open that group’s full list. The total across all groups appears near the paging controls when the list is grouped. Grouped lists whose filter includes a script include can run slowly.

Column heading menu: exporting a list

To export, select and hold, or right-click, any column header, choose an export option, and select Download when the export finishes.

Excel, CSV, JSON, PDF and Google Sheets are available to all users. XML is limited to users with the admin role. Export Set is limited to users with the export_set_admin or admin role.

Check these details before using an exported file:

  • The header row is the column label in Excel and PDF, and the database field name in CSV, XML and JSON. A script expecting field names will not find labels in an Excel file.
  • CSV files default to Windows-1252 encoding. For translated data, set the glide.export.csv.charset system property to UTF-8.
  • The platform applies a default upper limit to the size of an export, so a very large table may not come out in one file.
  • A list export runs in a background thread without the user’s session data, so the file can differ from the list view.

From a single record form, the export choices are PDF, with XML added for administrators. Exports can also be requested through a URL, through REST or SOAP web services, or by creating an export set.

List title menu: records per page

Right-click the list title and select Show, then the number of rows per page. No role is required. This preference applies to all lists you can access. The list refreshes and the page control reflects your selection; a smaller result set displays fewer records. Grouped lists use this row count as their display limit per group. The title menu also provides View for switching between list layouts you can access.

List field menu: quick filters

Right-click a value inside a row and the field menu opens. Its quick filter entries narrow a list in one click.

  • Show Matching keeps the rows that share the value you clicked.
  • Filter Out removes the rows that share it.
  • On date fields the menu offers Show Before, Show After and Filter Out.

Filter Out also keeps rows where the field is empty or null. A manually constructed inequality filter does not automatically include that empty-value condition. If a filtered list contains blank values, inspect the conditions before treating the results as an error.

After a quick filter runs, the filter appears as breadcrumbs above the list. Breadcrumbs read from left to right, from the most general condition to the most specific. Clicking a breadcrumb removes the conditions to its right and refreshes the list. Clicking the separator before a condition removes that condition alone. The All breadcrumb removes every condition, so the list returns to the unfiltered view.

Right-clicking a breadcrumb gives three choices: Open new window, Copy URL and Copy query. Copy query is not available on All.

Form context menu

On a record, click the icon beside the form title or right-click the form header. The menu has these entries:

  • Save: Keeps your edits and stays on the form.
  • Insert: Saves the data as a new record and returns to the previous page.
  • Insert and Stay: Saves the new record and displays it.
  • Configure: Administrative functions, such as configuring forms.
  • Export: Exports to PDF. Administrators can also export XML.
  • View: Switches the form to a predefined field layout. Switching submits the form and saves all changes.
  • Create Favorite: Adds the record to your favorites. Core UI only.
  • Copy URL: Copies the form view URL of the record to the clipboard. Browser security settings may block it.
  • Copy sys_id: Copies the sys_id to the clipboard. Administrators; browser settings may block it.
  • Show XML: Displays the record’s data as XML. Administrators.
  • History: Shows the audit history. Administrators; auditing must be enabled for the table.
  • Reload Form: Reloads data from the database to refresh the form view.

Because switching views submits the form, unsaved edits are saved at that moment.

Adding or changing a list context menu entry

A user with the admin role builds list menu entries as records. The path is All, then System UI, then UI Context Menus, then New. Complete the form and select Submit. The fields are:

  • Table: Where the option attaches. Base system items use the Global table, which applies them to all lists for all tables. A specific table limits the option to that table’s lists.
  • Menu: The list context menu where it appears. The choices include List title menus, Column headings and List fields.
  • Type: Action (immediate action), Menu (a parent that can show a submenu), Separator (a line between groups), Label (an unlinked label) or Dynamic actions (options built when the list displays, such as views or user filters).
  • Order: Sets the position of an item, menu, or separator.
  • Name: The text shown in the menu.
  • Parent: The parent menu item, when the entry belongs in a submenu.
  • Active: Turns the item on or off; only active items appear.
  • Condition: When the option appears.
  • Action script: Runs when the user picks the option.
  • Dynamic actions script: Populates the menu with dynamic options such as filters or views.
  • onShow script: Runs before the menu displays and decides which options appear. Select Run onShow script to reveal the field.

To nest an item, type the parent item’s name into Parent. Separators never sit next to each other or at the bottom of a menu, so if a role condition would leave two together, one is hidden.

Check a custom menu item before release

If an entry is missing, check its configuration in a test instance before changing a shared menu. Use the admin role for list context menu configuration, then test the result with the intended user’s access.

  1. Check Table and Menu together. An item assigned to List fields will not solve a missing option under Column headings. A table-specific item has a narrower reach than a Global item.
  2. Confirm Active is selected and inspect Condition. A condition can determine whether a role sees the item.
  3. Check Parent and Order when an entry appears in the wrong place. Parent takes the parent item’s name.
  4. Inspect the onShow script if the visible result changes with the selected column or grouping state. It runs before display; Action script runs after selection.

For help planning this work, see ServiceNow implementation.

Questions about context menu edge cases

Why is a table missing from the context menu form?

The Table list includes tables and database views in the same scope as the context menu. Check the scope before concluding that the table does not exist.

Which field details can an onShow script inspect?

It can use g_fieldName and g_fieldLabel for the current field, g_list for the GlideList2 object, g_menu and g_item for the menu and item, and g_sysId for the row or form identifier. Choose the variable that matches the decision the menu needs.

Can I export an embedded list through its column menu?

For an embedded list, export the record containing that list. Treat the parent record as the starting point instead of assuming the standalone list procedure applies.

Why does a new record already contain filter values?

New from a filtered list can preset fields from the filter. Review those values before saving. An administrator can use the ignore_filter_on_new=true dictionary attribute for a field that should not inherit them.