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

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

That seems to do the trick! I do have a question about it though. I had essentially tried this before, but was missing the caret by u_sub_building. In this scenario, what is the caret doing? Also, just in case I'm missing something, do you think the Variable attributes field would need to be updated as well?

It's the operator AND

Check below link 

https://docs.servicenow.com/bundle/paris-platform-user-interface/page/use/common-ui-elements/referen...

 

Yes for variable attributes you should replace floor and building with your table column names instead of variable names

 


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

It actually looks like I was a bit hasty in my response. The reference qualifier is only working for building now. So the rooms available in the field are now everything that belongs to the building, but the floor value isn't being taken into consideration.