Dependent drop downs

JohnnySnow
Mega Sage

Hi Team,

 

We have a requirement in a catalog item to implement dependent dropdowns. There are three lookup select boxes — SB1, SB2, and SB3 — each containing multiple dropdown values.

 

What is the best practice for configuring dependent dropdowns in ServiceNow?

 

Our Current Approach
We have added all dropdown options into the sys_choice table as below:

Table: sys_choice
Element: SB1
Value: abcd

 

Questions

Is it okay to use sys_choice and set the Table field to "sys_choice" within the sys_choice table itself? if not where should we put the choices if the number of choices are less than 30.

Should we be using a different table instead?

OR

Would it be better to create a custom table to store all lookup values and then configure the dependent dropdowns using reference fields and reference qualifiers?

 

 

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.
9 REPLIES 9

Tanushree Maiti
Kilo Patron

Hi @JohnnySnow ,

 

If " in a catalog item to implement dependent dropdowns." then in sys_choice table , 

table would be sc_req_item.

 

Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

@Tanushree Maiti I'll try that

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.

Ankur Bawiskar
Tera Patron

@JohnnySnow 

why are you using sys_choice?

sys_choice requires a table field but here you are using catalog item where variables are there, in this case are you creating some field on some table and then using that?

You can create Select box variable and add choices in question_choice table and then handle the dependency by removing/adding options using g_form.addOption() and g_form.removeOption()

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar  there are lot of choices and using scripting to achieve wouldnt be easy. Also with question_choice table, there is no 'dependent value' field which we have in 'sys_choice' table and hence makes it easier to achieve it. Hence the question, if we can use the sys_choice table, if yes, what should we put in the table field?

Thanks
Johnny

Please mark this response as correct or helpful if it assisted you with your question.