How to sort a table by choices in a catalog item and display it in the next question's choices

nakamura323
Kilo Guru

Hello.


Prepare two questions for the catalog item.
First, select company.
The second step is to select department.

I would like to change the items displayed in the department question depending on the company selected.
Example) If the company name is ABC, only those whose department name includes ABC will be displayed...

 

All departments are stored in one table, and the referenced table cannot be changed.

How can this be achieved?


thank you.

3 REPLIES 3

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @nakamura323,

 

1. Go to the catalog varaible > department.

2. select adv reference qualififer

3. Apply > javascript: "company="+current.your_company_var+"^active=true^EQ"

4. save.

 

i hope this helps....

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @nakamura323 

 

You can make the 2nd variable as dependent on 1st one.  Like we have on form.

 

https://www.servicenow.com/community/developer-forum/using-dependent-fields-in-service-portal/m-p/20...

 

https://www.servicenow.com/community/developer-forum/how-to-make-variables-in-catalog-item-dependent...

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Service_RNow
Mega Sage