Reference Qualifier based on the other field value

florian29
Tera Contributor

Hi Team,

How to limit the values for a reference field based on the other field value.

The first variable is of type select_box and is used to set the category.

The second variable is a reference field, which should only show the records where the category agrees.

Both variables refer to the same table.

I tried to use the following reference qual. for the second variable

javascript: 'u_category = '+current.variables.software_leistungsfeld

but it doesn't work.

Can some help me?

5 REPLIES 5

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

please use the Dependent Field, set Dependent with the field name of your second variable, this will fit your need.

Any doubts, refer to the following official documentation:

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/field-administrat...

If I have answered your question, please mark my response as correct and/or helpful so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

 

Dubz
Mega Sage

Hi Florian,

The syntax you have used there should work as an advanced reference qualifier assuming your field/variable names are correct. I would recommend checking the value of the software_leistungsfeld variable against the values stored in the u_category field. Sometimes choice options in categories can be numeric or lower case so best just to confirm you're checking like for like.

Cheers

Dave

florian29
Tera Contributor

I solved the problem, it was a missing Semicolon in javascript: 'u_category = '+current.variables.software_leistungsfeld;

Huh, i'm pretty sure i have reference qualifiers running without the semi-colon, didn't think it was required, it certainly shouldn't break things!

Anyway, glad you have it working, mark your answer correct to close the thread down.