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.
Interacting with a Glide List field - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Interacting with a Glide List field
KB0596181

Interacting with a Glide List field


43472 Views Last updated : Apr 7, 2024 public Copy Permalink English (Original)
  • English (Original)
  • Japanese
KB Summary by Now Assist

Issue

There are a number of limitations/restrictions when attempting to interact with a Glide List (glide_list) field in a List view:

  • When attempting to perform a search on a Glide List field (for example, the Watch list on Incident), the Search box at the top of the list it is not available:



  • The Group By option is not available for a Glide List field.

  • Unable to sort alphabetically on the Glide List field:

Release

All ServiceNow releases

Cause

Similar to the behavior of a Reference Field, a field of type Glide List (glide_list) stores the Sys ID of a referenced record. However, that is where the similarities end, as the field type allows for storing multiple Sys IDs as well as email addresses. In the database this is stored as a comma-delimited string.

For example, here is an Incident with some users in the Watch List:

Running a script to obtain the value of this field returns the following output:

*** Script: 62826bf03710200044e0bfc8bcbe5df1,5137153cc611227c000bbd1bd8cd2007,sampleuser@test.com

Observing this, performing searches with display values would not be successful, becaus the search is taking place against the stored values. So "watch_listLIKEAbel Tuter" is not the same as "watch_listLIKE62826bf03710200044e0bfc8bcbe5df1." For this reason the sort is disabled on this field type.

This behavior also affects the grouping of this field type because grouping is done on the stored value of a record. For example, no two records are guaranteed to have the same arrangement of referenced values. So, the Watch List in one record might have Abel Tuter and David Loo, but in another record it could be David Loo and Abel Tuter.

Resolution

There is no actual resolution to the limitations, but there are some workarounds, based on what you are trying to achieve.

Searching 

To accomplish a successful search in the list view:

  1. Expand the list filter.
  2. Select the List field to search.
    A very limited list of search operators (contains, does not contain, is empty, is not empty) is displayed.
  3. Select an operator.
  4. In the reference search box, select a referenced record using the Lookup icon.
  5. Run the search.


Note: If you are showing a Glide List field on the layout of the list view, do not get confused with the output of the value. The search is working as expected, as it is returning only those records where the Glide List matches that search criteria. You are seeing all the available values of the Glide List field.


Grouping 

To group on the Glide List field, add the can_group=true attribute to the respective dictionary entry. This makes the Group By option available. Note the behavior explained in the Cause section (above) because the output looks like it does not group logically.


Scripting 

When scripting, note the following information in the product documentation:

  • Referencing a Glide list from a script
  • Using indexOf("searchString")

Another tip for scripting, particularly with filtering (addQuery or addEncodedQuery), is to create a helper function that takes the display value (performing the necessary lookup) and then returns the Sys ID of that desired record. For example, the following script searches for incidents where Abel Tuter is on the Watch list:

var inc = new GlideRecord('incident');
inc.addEncodedQuery('watch_listLIKE' + getUserSID('Abel Tuter'));
inc.query();

while (inc._next()) {
  gs.print(inc.number + " | " + inc.watch_list);
}

function getUserSID(name) {
  var user = new GlideRecord('sys_user');
  if (user.get('name', name)) {
    return user.sys_id;
  }
}

You can also use the getDisplayValue function call that outputs the Display Values of the referenced records instead of the Sys IDs. So:

gs.print(inc.number + " | " + inc.watch_list);

becomes:

gs.print(inc.number + " | " + inc.watch_list.getDisplayValue());


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?

Attachments

Attachments

  • Group By.png
  • Search Box.png
  • Watch List filter search.png
  • Watch List group.png
  • Watch List on Form.png

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.