Reference Qualifiers in ServiceNow

What are Reference Qualifiers?

TLDR

This is the TLDR of Chuck Tomasi's walkthrough.

Simply put, Reference Qualifiers are filters on reference fields.

To me Reference Qualifiers are like User Criteria (for catalog items) but instead for reference fields.

There are three types of Reference Qualifiers:

  • Simple
  • Dynamic
  • Advanced

Simple Reference Qualifier

Simple reference qualifiers are simple filters. These are static filters.

For example:

You want to implement a simple reference qualifier on the Incident table to filter out the inactive caller.

How do you do that?

You can implement this via the Dictionary Entry of a reference field.

Chuck Tomassi's tutorial for detailed instructions (min 10:34) on how exactly to do that.

NOTE:

There are already plenty of OOTB reference qualifiers implemented on different reference fields.

For example:


In the image above you can see the OOTB reference qualifier for the Assigned To field.

You can override attributes of the Assigned To field including the reference qualifier.

The Dictionary Overrides is the place where you do that:


This could be helpful when you are creating a scoped app that has nothing to do with ITSM.

For the Caller field, however, there is no OOTB ref qualifier. If you right-click on show on the Caller field you see that the Caller field doesn't have an OOTB ref qualifier:


Dynamic Reference Qualifier

Dynamic Reference Qualifier allows you to create dynamic filters.

Example:


A Dynamic Reference Qualifier all is doing is returning a value of a reference field.

To build dynamic filters you need to build a Dynamic Filter Option. 

An example of a Dynamic Filter Option:


Another example of a Dynamic Filter Option.

This is also a cool example.

Available for filter checkbox means that the filter is accessible on the filter list as you can see in the example above.

Furthermore, you can build simple but also very complex Dynamic Filter Options with script includes:


Here is a concise SN article on creating a Dynamic Filter Option.

If you wanna know more about Dynamic Filter Options, then please have a look at this great resource that will walk you through in more detail how to build dynamic filters.  

Advanced Reference Qualifier

The key to an advanced filter is getting the encoded query string right.

Advanced reference qualifiers allow you to build advanced conditions with lots of filters.

Example: 34:40

Advanced reference qualifiers are great for dealing with dates (start & end time). What this specifically means is that they are dynamic to the forms.

In other words, an advanced ref qualifier is pulling all the parameters together to filter the list according to your needs.

A good way how to build advanced ref qualifiers is by building the filters hardcoded in the list filter and then replacing the filters with parameters (ref: 39:10).

Example of a hardcoded list filter:


This short article walks you through how to build an advanced ref qualifier.

Another interesting example of an advanced ref qualifier.

Side note:

You can unit test your script includes with script background.

Example:


Basically, advanced ref qualifiers are very powerful. They take and execute queries and return sys_ids. And remember: advanced ref qualifiers are unique to each field!

That's a wrap!

Here is the official SN documentation on reference qualifiers.

I hope I cleared some doubts about these filters. 

If you still have doubts, then check this article which explains the difference between Dynamic Filter and Advanced Filter.

Additional resources:
  • https://www.youtube.com/watch?v=LsT6Wqm-Y0M&ab_channel=SKFactsandITCareers
  • https://www.youtube.com/watch?app=desktop&v=Z9C6X1uNAZU&ab_channel=DiscussToLearn
  • https://www.youtube.com/watch?v=SFr4BZz2eIc&ab_channel=SKFactsandITCareers

Comments

Popular Posts