Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

🎯 Mastering Reference Qualifiers in ServiceNow: Types, Use Cases, and Pro Tips

Bhavesh Patil
Tera Contributor

Hey #ServiceNowCommunity 👋

Ever wondered how ServiceNow controls which records appear in a reference field dropdown?

That magic happens thanks to Reference Qualifiers!

In this post, we'll dive deep into:

  • What Reference Qualifiers are

  • Their types and real-time examples

  • Best practices

  • Real-world use cases

  • And some must-know pro tips!

Let’s get started 🚀


🔍 What is a Reference Qualifier?

A Reference Qualifier is used in ServiceNow to filter records displayed in a reference field.
OR we can say A Reference qualifier script is basically a filter that is used to restrict the data that selected for a reference field.

Think of it as a rule that says:

"Only show me specific records in this field dropdown based on certain conditions."

📌 Why is it important?

  • Enhances data accuracy

  • Reduces user confusion

  • Helps maintain clean data relationships

  • Makes forms dynamic and intelligent


🧩 Types of Reference Qualifiers (with Examples)

ServiceNow offers three main types of Reference Qualifiers:


🔹 1. Simple Reference Qualifier

Used when you want to apply a static filter condition directly in the field definition.
For Simple reference qualifiers we use AND/OR conditions to create simple filters.

🛠️ Example:
Only show Active Users in the Assigned To field.

Reference Qualifier (condition):

active=true

✅ Easy to configure
❌ Not dynamic or flexible


🔹 2. Dynamic Reference Qualifier

Uses predefined dynamic filters (saved in Dynamic Filter Option table) to control dropdown options.

🛠️ Example:
Show only users in the same department as the caller.

  1. Create a dynamic filter: Users in Caller’s Department

  2. Use that dynamic filter in the reference field

✅ Reusable across tables
✅ Easier to maintain
❌ Limited to filter options


🔹 3. Advanced Reference Qualifier (Scripted)

The most flexible and powerful method.
You can write JavaScript logic to filter options based on current form data or session info.

🛠️ Example:
Show only incidents created by the logged-in user.

Reference Qualifier (Advanced Script):

answer = 'opened_by=' + gs.getUserID();

Or use form data like this:

(function() {
    if (current.company)
        return 'company=' + current.company;
    else
        return '';
})();

✅ Highly dynamic
✅ Supports current and gs
✅ Can use complex logic
❌ Needs scripting knowledge


💼 Real-Time Use Cases of Reference Qualifier

  1. 🔒 Show only active users in reference fields like Assigned To or Watch List

  2. 🏢 Filter Locations based on the selected Company

  3. 👩‍💼 Show only Managers from a specific Department

  4. 📝 Display only active Catalog Items in a variable reference

  5. 📦 Filter related incidents for a Problem Record by matching Caller/Service


✅ Best Practices for Reference Qualifiers

✅ Use Simple qualifiers for basic filters (active=true)
✅ Leverage Dynamic Filters for reusable business rules
✅ Use Advanced only when you need custom logic
✅ Always test your scripts thoroughly—use gs.info() for debugging
✅ Avoid unnecessary scripting—keep performance in mind
✅ Document your logic for future maintainability
✅ Validate that your filters are not excluding needed records


💡 Pro Tips

🔹 Use current carefully in advanced qualifiers—it refers to the form's GlideRecord
🔹 In Catalog Items, use g_form.getReference() and setRefQual in Client Scripts for dynamic reference qualifiers
🔹 You can combine multiple fields in your filter using AND, OR logic
🔹 Use GlideFilter or GlideRecord inside script includes if the logic is complex
🔹 Avoid using global variables inside qualifiers—keep them self-contained


🏁 Final Thoughts

Reference Qualifiers might seem small, but they have a huge impact on form usability and data quality. Mastering them allows you to build intelligent, responsive, and user-friendly forms in ServiceNow.

Got a tricky use case for reference qualifiers? Let’s discuss it in the comments! 💬


**Please mark it as *Helpful* or *Correct* — it really means a lot!**

1 REPLY 1