How to filter select box selection base on another field selected option? Catalog Item Form

Gian1
Tera Contributor

We have catalog item that has the following field 


Look up select box field called Campus - Which references the u_campus field in the table cmn_location 

and

Reference field called Exam Room Location - Which references the cmn_location

 

What we want is when a user Selects a campus for example "City Campus" The exam room location selection should only show the rooms from the city campus and if they change to North Campus the exam room location selections should only show rooms from north campus.

 

I tried to do an onchange script that did not work.

 

Any help will be much appreciated. Thank you

 

 

1 ACCEPTED SOLUTION

Hi @Gian1 

 

Ok got it...

reference qualifier should be highlighted in below screenshot

 

VishalBirajdar7_0-1695180057229.png

 

Actually , colon (:) will get converted here in community text editor.

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

8 REPLIES 8

Vishal Birajdar
Giga Sage

Hi @Gian1 ,

 

You can use Advanced reference qualifier on "Exam Room Location" field

 

javascript : 'u_campus=' + current.variables.campus;

u_campus - field from cmn_location 

campus - variable from catalog item // use your variable backend name

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

Thank you for your reply, but unfortunately it's not working

Hi @Gian1 

 

Can you provide some screenshot if possible..?? (reference qualifier of Exam room location and look up select box field type specification)

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

This is the Campus field in Cat Item

Gian1_0-1695179525284.png

Gian1_1-1695179575972.png

 

This is the exam room location field in cat item

Gian1_2-1695179618912.png

Gian1_3-1695179648594.png