Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Lookup Select Box variable value not showing on RITM/TASK (Classic UI & SOW)

savaliya
Tera Expert

Hi everyone,

I’m having an issue with a Lookup Select Box variable on one of my catalog items.

I have a Category variable and a dependent Subcategory variable that is a Lookup Select Box. The Subcategory is using a reference qualifier to dynamically query the Choice (sys_choice) table based on the Category selected.

Everything works perfectly in the Service Portal — the dependent Subcategory values show correctly when the user changes a Category.

However, when a user changes the Category on the RITM in the classic UI or in SOW, the Subcategory lookup still shows results based on the previous Category value instead of updating to match the newly selected Category.

Since it works fine in the Portal but not in the backend forms, I’m wondering if Lookup Select Box variables have limitations on RITM/TASK forms or if additional configuration is required.

Has anyone run into this or know what might be missing?


Thanks in advance!
Lalit

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

Ensure your Subcategory variable has the Variable attributes on the Type Specifications tab similar to this:

BradBowman_0-1763844459268.png

Where 'v_category' is the name of the Category variable.  This attribute is needed on Lookup Select Box and List Collector type variables that use a dynamic reference qualifier which includes a dependency on another variable, so that the qualifier is updated when that dependent variable value changes.

View solution in original post

6 REPLIES 6

No, i am not using any Catalog Client Scripts or UI Policies to query my results. I am just using Reference Qualifier.

MackI
Kilo Sage

hi @savaliya 

 

Short answer:
Lookup Select Box does work on RITM / TASK forms, but for dynamic reference qualifiers to refresh when another variable changes in the classic UI / SOW, you must:

Add the ref_qual_elements attribute on the Subcategory variable, and
(If you’re using any catalog client scripts/UI policies) ensure they’re set to apply on RITM / Catalog Tasks.

Why it works in Service Portal but not in classic UI/SOW


In Service Portal, the catalog widgets automatically watch the “controlling” variable(s) listed in ref_qual_elements (and sometimes even work without it, depending on how the ref qual is written).
In the Variable Editor on RITM / TASK forms (classic UI, SOW), the system won’t know that Subcategory depends on Category unless you explicitly tell it via ref_qual_elements. That attribute is what forces the lookup to re-run the reference qualifier when Category changes.ServiceNow+1
Right now, your Subcategory’s ref qual runs once and then just keeps the old result set, which is why you still see values for the previous Category.


What you should configure
1. Add ref_qual_elements to the Subcategory variable
On your Subcategory variable (Lookup Select Box):

Open the variable record (on the item or variable set).
Go to Type Specifications tab.
In Attributes, add:

 
ref_qual_elements=v_category

…where v_category is the exact Name of your Category variable (not the Question text).

If you have multiple dependencies, use ;:

 
ref_qual_elements=v_category;another_dep

This tells the Variable Editor:

“Whenever v_category changes, re-evaluate the reference qualifier for this Lookup Select Box.”
This is specifically called out for Lookup Select Box & List Collector variables that use dynamic reference qualifiers

 

A small request from my end, If you like this opinion and your problem is resolved after reviewing and applying it. Please kindly mark this your best answer‌🌠‌ OR  mark it  Helpful ‌‌ if you think that you get some insight from this content relevant to your problem and help me to contribute more to this community

MackI | ServiceNow Technical Consultant | DXC Technology Australia | ServiceNow Practice | LinkedIn Top IT Operation Voice 2023 | Sydney,Australia