Record Producer dependent drop down

servicetrout
Tera Expert

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

deptIDdeptNamedivIDdivName
1DeptName110Div1a
1DeptName120Div1b
1DeptName130Div1c
2DeptName211Div2a
2Deptname212Div2b
2DeptName213Div2c
3DeptName314Div3a
3DeptName315Div3b

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.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

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      


View solution in original post

6 REPLIES 6

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


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