How can I use two reference qualifiers in catalog variable?

Casey23
Tera Guru

We are creating a catalog item where lookup select boxes are dependent on one another to choose a room at a facility. 

Campus > Building > Floor > Room

We have reference qualifiers and variable attributes setup so that only buildings for the correct campus show up, only the correct floor for the building show up and I'm trying to get the correct setup for room. Currently the way room is setup is that it is dependent on floor. But I need it to be dependent on floor and building.

The current setup is:

Reference Qualifier: javascript:'u_floor='+current.variables.floor

Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=floor

What I would like to add to that is :

Reference Qualifier: javascript:'u_sub_building='+current.variables.building

Variable attributes:ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=building

I'm just not sure now to combine those two and I haven't been able to find any examples of people doing this. Has anyone done this before or know how I can accomplish this?find_real_file.png

1 ACCEPTED SOLUTION

Voona Rohila
Kilo Patron
Kilo Patron

Can you try this:

javascript:'u_floor='+current.variables.floor+'^u_sub_building='+current.variables.building

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

View solution in original post

15 REPLIES 15

I tried that reference qualifier again as I was creating some fake data in the table for you and noticed that it was working. I started going through each of the locations, floors and rooms in the table and noticed that the import data I was given was incorrect in some instances. For example rooms that start with a '2' (ex. 201, 202, 203) are generally on the second floor, but in this case, they were listed as being on the first floor. After running into a few instances like that, I cleaned up some of the data and everything is looking good now.

Thank you for the help on this, I truly appreciate it!

Glad to help 🙂


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Thanks, this one with "NQ" (it means Next Qualifier I guess) works for me while "OR" not. My scenario is to get values from two variables on the form and compare with their custom field "u_collector_value":

 

javascript: 'question.question_text=Required equipment to prepare -fixed equipment^inactive=false^u_collector_value=' + current.variables.boardrooms + '^NQquestion.question_text=Required equipment to prepare -fixed equipment^inactive=false^u_collector_value=' + current.variables.select_a_boardroom

@eviljack - Did you try the same way as below for 'OR'?

javascript: 'question.question_text=Required equipment to prepare -fixed equipment^inactive=false^u_collector_value=' + current.variables.boardrooms + '^ORu_collector_value=' +current.variables.select_a_boardroom


 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Yes, I did, but it ignores the first part and takes only the last condition.