- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 02:56 PM
Looking for guidance on how to create a dependent drop down in a record producer.
The record producer has a department field and a division field.
The list of choices for the departments is a "Lookup Select Box" based on a table like myDept table below.
I say "like" because I couldn't figure out how to remove duplicates when setting up a Lookup Select Box on a table with replicates, so created a separate table for it with distinct values.
What I would like to do is set up another field that works like a "Lookup Select Box", or could even be a "Lookup Select Box" if that works for divisions.
Depending on what the user selects for a department, the dependent lookup should determine what divisions are shown in the dependent list.
That is, based on the table below if the user selects DeptName1, they should see in the drop down for the Division field as:
Div1a
Div1b
Div1c
Table: myDept
deptID | deptName | divID | divName |
---|---|---|---|
1 | DeptName1 | 10 | Div1a |
1 | DeptName1 | 20 | Div1b |
1 | DeptName1 | 30 | Div1c |
2 | DeptName2 | 11 | Div2a |
2 | Deptname2 | 12 | Div2b |
2 | DeptName2 | 13 | Div2c |
3 | DeptName3 | 14 | Div3a |
3 | DeptName3 | 15 | Div3b |
Here are my questions:
1) What are the steps to set up such a dependent list ?
2) Can this be done by using the table above, or splitting the divisions out into their own lookup table? (e.g. divID, divname)
Yes, the table methods is preferred because we are talking about 1200 departments and many more divisions.
3) Would a Catalog client script be an effective way of doing this? If so how?
Thank you for sharing your expertise in advance. I am a novice script-er that this point, but trying to learn fast.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-02-2017 06:08 PM
HI Glenn,
You'll need to build this yourself using a catalog client script and a GlideAjax call. Take a look at episode 33 here: TechNow Episode List it will help you get a list of options set up for the second drop down list.
Docs: Client Scripts
Docs: GlideForm
Docs: GlideAjax
Client Script Best Practices - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-13-2017 02:54 PM
Hi Glenn,
No problem. Whenever possible, I try to make the slides and code used in TechNow available for others.
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2017 02:18 AM
Hi Glenn
I have a similar situation with lookup select boxes that I need to make dependent on each other also one for Division then Department en then a third for Location and based on that the user will see the relevant record. I want to ask if you could possibly share your solution, I have built a script include which I am referencing from the field in the record producer with an advanced ref qualifier. I am so close but just cannot seem to finally get it working.
I would appreciate it.
Regards