Announcing the Global SNUG Board of Directors. Learn more here

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
asifnoor
Kilo Patron
Kilo Patron

Hi,

In this article, I am going to explain the use of reference qualifiers.

As you all aware, a reference field in SN basically means a reference to a field in another table. When you make the reference field visible on the form, then it basically fetches all the values of the field from the other table and display them. But if you want to filter the values that you want to show in the reference field, then you can use reference qualifiers.

There are 3 types of Reference Qualifiers.

  • Simple
  • Dynamic
  • Advanced

How to create a Reference Qualifier

  • Right click on the reference in the form
  • And select Configure Dictionary
  • Then under Reference specifications tab, you will see afield "User Reference Qualifier"
  • Under that, select the type of Reference Qualifier (Simple/Dynamic/Advanced)

Simple Reference Qualifier

Simple reference qualifier is used when you want to filter the rows using AND/OR conditions. For example, if you want to filter all users which are active, then you can use simple reference Qualifier.

To create simple reference qualifier, follow the steps as given above. Then once you select Simple under User Reference Qualifier, then you will see a field Reference Qual Conditions. here you can select the conditions such as Active = true and update.

Then the field will only show all users who are Active = True.

Look at the below screenshot which shows only active callers that belong to company ACME Africa in the incident form.

find_real_file.png

 

Dynamic Reference Qualifier

Dynamic reference qualifiers enable you to use a dynamic filter option to run a query against a reference field to filter the returned data set. Dynamic filter options are stored filters that can contain encoded query strings, JavaScript, or script includes and can be used in multiple dynamic reference qualifiers. 

The base instance provides several OOB dynamic filter options. If a dynamic filter option that meets your needs does not exist, you can create a new dynamic filter option that is specific to your requirements. 

To locate the available dynamic filter options, navigate to System Definition → Dynamic Filter Options. In the right-corner of the Dynamic Filter Options list, click the filter icon and create the filter condition Available for ref qual is true. All dynamic filter options that can be used in dynamic reference qualifiers appear.
 
Let us try to use the same example of active callers using Dynamic Reference Qualifier.
  • First let's create a dynamic filter as shown in below screenshot.
  • Then go to reference specifications and update the reference qualifier to dynamic and use that filter as shown in below screenshot.

find_real_file.png

Then configure the Reference Qualifier as below.

find_real_file.png

 

Advanced Reference Qualifier

Advanced reference qualifiers enable you to write a script to filter the result set which you cannot do either with simple or dynamic reference qualifiers. Also with Advanced reference qualifier, you can filter the result set based on the other field. 

Here is how you can configure advanced Reference Qualifier.

Let us write a simple script include which returns the active callers who belong to ACME Africa Company.

find_real_file.png

 Now Call this Script Include from the reference Qualifier like below.

find_real_file.png

 

In Advanced Reference Qualifier, without using the Script include, you can achieve this like below.

  • Add company field to the incident form.
  • Based on the selection of the company, we can filter the active callers.

find_real_file.png

Ref: https://docs.servicenow.com/bundle/madrid-platform-administration/page/script/server-scripting/conce...

If you find this article useful, kindly bookmark it and click on the helpful button.

Version history
Last update:
‎06-17-2019 06:56 AM
Updated by: