Pradyumna Das
Tera Expert

In this Article, we will be diving into one of the lesser-known features of ServiceNow - how to add a filter in a list collector or reference type of field, without using script include and reference qualifier. For those who are unfamiliar with these features, a list collector is a field that allows the user to select one or more items from a list of options. A reference type of field, on the other hand, is a field that allows the user to select a single record from a table. Traditionally, adding a filter to these types of fields in ServiceNow would require the use of a script include or reference qualifier, which can be quite cumbersome and time-consuming. However, there is a simpler way to achieve the same result, and that is what this article aims to demonstrate. To start off, we will be showing you how to add a filter in a list collector field. This is achieved by using the 'glide_list' API to retrieve the list of options, applying the necessary filter, and then setting the option list back to the field. We will be walking you through this process step by step, starting with the creation of a new Catalog Item and the addition of a list collector/Reference field. Next up, we will be demonstrating how to add a filter in a List Collector/Reference type of field. In conclusion, this video demonstrates how to add a filter in both list collector and reference type of fields in ServiceNow, without the need for a script include or reference qualifier. This feature can help save time and effort for developers and administrators and we hope the below video will be useful to anyone looking to use it in their own ServiceNow implementations.

 

Click Here if you are not able to View/Play the video.

 

 

Please mark it helpful if it helps you in any manner.

 

Comments
Community Alums
Not applicable

Hi @Pradyumna Das , Thanks for the video, does this work on reference catalog variable in a MRVS? I need to add a filter query which I get via a script include to be applied to reference variable in catalog form via client script. Also it does not seem to work in desktop UI.

Lisa Conn
Tera Expert

Very helpful, thank you Sir!

Nanditha Aitha
Tera Contributor

Pradyumna Das - This works I am using it for user table but the search does not work on the variable after using this script. Any suggestions

Version history
Last update:
‎05-26-2023 04:00 AM
Updated by:
Contributors