- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 09:00 AM
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?
Solved! Go to Solution.
- Labels:
-
Request Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 09:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 10:41 AM
Then I guess you want campus records to be selected based on floor or building
javascript:'u_floor='+current.variables.floor+'^NQu_sub_building='+current.variables.building
If this is not giving the expected results then can you show the campus records and how these are dependent
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021 10:59 AM
That didn't seem to work either. All of the original options are available again as if I were just looking at floor. Here is how the other variables are configured:
Campus
Reference qualifier:
Variable attributes:
Building
Reference qualifier: javascript:'u_location='+current.variables.campus
Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=campus
Floor
Reference qualifier: javascript:'u_sub_building='+current.variables.building
Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=building
Room
Reference qualifier: javascript:'u_floor='+current.variables.floor
Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=floor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 12:14 AM
Modify variable attributes
Campus
Reference qualifier:
Variable attributes:
Building
Reference qualifier: javascript:'u_location='+current.variables.campus
Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=u_campus
Floor
Reference qualifier: javascript:'u_sub_building='+current.variables.building
Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=u_sub_building
Room
Reference qualifier: javascript:'u_floor='+current.variables.floor
Variable attributes: ref_auto_completer=AJAXReferenceChoice,ref_qual_elements=u_floor
So, You need room dependent on floor and building but from above configuration room is indirectly dependent on building too .
Room is dependent on Floor and Floor is dependent on Building.
so when you see records from room, you are taking value from floor( which is dependent on 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 08:35 AM
Hello,
Changing the variable attributes to the field name in the table breaks the lookup select boxes. With those changes, clicking the dropdown doesn't show any options in any of those fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 08:59 AM
Oh I'm sorry, I'm not really sure how ref_qual_elements attribute actually works
Reference qualifier for room(dependent on floor and building) javascript:'u_floor='+current.variables.floor+'^u_sub_building='+current.variables.building
If this didn't helped then can you share the table data with one example so that we can build proper query.
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