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.

Populate reference variable options based off another reference variable.

Mark OToole1980
Tera Contributor

Hope you can help.  I am building a catalog item and need 2 reference variable to link to each other.

 

Variable 1 Faculty which a lookup select box referenced to a custom faculty table.  

Variable 2 School also needs to be a lookup select box referencing the custom school table.

 

The custom school table has a parent field that links to the Faculty table.

 

So I need the school variable to only show the records in the school table that have a parent of the option chosen in the faculty variable.

 

I have posted a picture of the simple form so far. How do I achieve this?  many Thanks

1 ACCEPTED SOLUTION

Sandeep Rajput
Tera Patron
Tera Patron

@Mark OToole1980 Please update the reference qualifier of the school field as follows.

 

Screenshot 2024-02-29 at 4.33.22 PM.png

View solution in original post

11 REPLIES 11

Import: You have to the add the attribute "ref_qual_elements=faculty", so the filter is dynamically recalculated.

Amit Verma
Kilo Patron
Kilo Patron

Hi @Mark OToole1980 

 

You can put an advanced reference qualifier on the school field as below :

 

javascript: 'u_parent=' + current.variables.u_faculty;

 

The above reference qualifier assumes your field names to be u_parent and u_faculty respectively so please change it if required.

 

Thanks & Regards

Amit Verma


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