Cascading Lookup Fields using Reference Qualifiers not working

Suzanne_Ryan
Giga Expert

I'm building a scoped app.  

The main table is extended from Task.

I have a custom Lookup table that has three columns:  Program, Subsection, Test

On the main table, I have three reference fields, one for each column. 

I want to be able to choose the Program first.  Then, with the lookup table filtered on the Program value, choose the Subsection.  Then with the lookup table filtered on the Program and Subsection, choose the test. 

 

I've tried setting the main table fields up as choice fields using the lookup as the source of the choices, but then i can't filter it.  Plus it keeps creating new records every time i make a choice, so that's a hard no.

 

I've tried setting them up as reference fields as shown in the image.  Not shown - the dependent field is program.  It doesn't work. 

 

Not only doesn't this work, but I have reference fields to sys_user on the main table that don't work either.   I checked a catalog item dictionary entry and there was no special set up for a user field.  Not sure what I'm missing here. 

 

Please help.  I don't know why ServiceNow makes this so hard. 

7 REPLIES 7

Below is an example of a reference qualifier. 

SanjivMeher_1-1699049771508.png

 

When you say On the main table, I have three reference fields, one for each column., Every record referenced represents a record. So if you have Program, Subsection, Test all a single record and you want to select them in the main table as 3 reference, it mayn't work. I am not sure, if you are suppose to use a reference field or a Choice field. In a choice field, yes you have that option. In choice, you can create choices for Program, and then Subsection as choices with parent as program and Test as Choices with Subsection as Parent.

 


Please mark this response as correct or helpful if it assisted you with your question.

Suzanne_Ryan
Giga Expert

Can anybody show me examples of a working reference qualifier?  I'm totally baffled by the fact that anything i put in my reference qualifier field makes absolutely no difference to the records selected in the lookup table.  I actually put in a literal value (javascript: 'program='PROGRAMNAME;) and it didn't make a difference. Could this be permissions? 

 

What the heck am i missing???

If you have an invalid format/syntax, or anything that cannot be resolved to return records, the qualifier will be ignored.  Your latest example is missing a plus sign before PROGRAMNAME, and it is unclear what you mean by this.  If the program field on the referenced custom table is itself a reference field, than you would need to hardcode a sys_id for this example to work.  There are many out of the box examples of reference qualifiers for you to look at, to see where your attempts and/or custom table might not be following.  You can also follow the examples in the documentation:

https://docs.servicenow.com/bundle/vancouver-platform-administration/page/script/server-scripting/co... 

 

Trying to follow your example with your custom tables is confusing without understanding the full tables and relationships.  And are you doing this on a table record/form, or a Catalog Item?  As my cohort pointed out, it seems like you're trying to filter your lookup table by the selected program.  If your lookup table truly has only 3 columns and your reference field or Catalog Item variable is referencing the lookup table, you will get a list of records from this table that match the criteria (once it's valid), which means it will show you the sys_id or whatever your Display column is on the lookup table of records that have that program, but it sounds like you're looking for a list of values for one of the columns - Subsection.