Dependent drop downs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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?
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @JohnnySnow ,
If " in a catalog item to implement dependent dropdowns." then in sys_choice table ,
table would be sc_req_item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@Tanushree Maiti I'll try that
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
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?
Johnny
Please mark this response as correct or helpful if it assisted you with your question.
