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

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      


Thank you, Chuck.   Will read through these.


Hi Glenn,



Let me know if you are blocked on any specific details. Also helpful may be episode 33 of TechNow.   We did a specific example of passing complex data via GlideAjax using a JSON object. It works well!



TechNow Episode List


servicetrout
Tera Expert

Thank you, Chuck. I checked out your TechNow video 33 and a few others, which were helpful.     I have a shallow Java coding background so at the moment I am hitting impasses daily.   Anything more specific I will post in another thread.   Thank you again, for your support.