Reference Qualifier - Location of Resource

JonnyFoster
Tera Contributor

Hi friends

 

I reckon this is really simple, however I'm having a bit a New Year brain blocker. 

 

I'm creating a catalog item for a pool car booking request. Luckily, we currently only have four pool cars in our organisation spread across three locations, but that means that one location has two pool cars to choose from and I would like users to be able to specify which car they want when they select the location with two cars available.

 

I've added the pool cars to the ci_vehicles table with pretty arbitrary information and made the location field active in that form to show where the cars are based. For the locations that only have one car available, I've made a UI policy which selects that vehicle and makes the field read only, but for the location with two cars, I'd users to be able to select which one they want. 

 

Field names are collection_location and vehicle_selection.

 

Will I need to go down a script includes for this, or will some clever advanced reference qualifying help?

 

 

JonnyFoster_0-1768900417907.png

Thanks in advance. 

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@JonnyFoster 

variable types for both the variables?

share screenshot

to filter and show records based on other variable, you need to use advanced ref qualifier in that variable

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Mohammed8
Giga Sage

Hi @JonnyFoster 

Assuming both are reference qualifier I think advanced reference qualifier should be sufficient.

Example like:

javascript:'location=' + current.collection_location

 

Although I don’t have the exact catalog variable as yours to test, I verified this behavior on the Incident form. With Location and CI fields present, the cmdb_ci field is correctly filtered based on the selected Location using an advanced reference qualifier.

 

Mohammed8_0-1768903075181.png

 

 

Advance qualifier used:

 

Mohammed8_1-1768902655722.png

 

You can try a similar approach by Navigating to the dictionary entry for the reference field and add advanced reference qualifier there

 

If you find this helpful, please mark it as solution accepted/helpful.

 

Thanks and Regards,

Mohammed Zakir