- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 07:50 AM
Hi, guys
There's a need for me to create an catalog item which has 2 variables.
One of them would be a Selectbox with many options.
The second one, would also be a Selectbox (or a Reference field) that depends on the first one's answer.
Example:
If the user selects "A" for first variable, it should appear the options "2" and "3" at the second variable.
If the user selects "B" for first variable, it should appear the options "4" and "5" at the second variable.
What's the best practice when it comes to this need?
We understood that a catalog client script for this wouldn't be fitting because there's too many dependent values, unless we created an auxiliar table for that.
Kind regards,
Natasha Machado.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2022 04:59 PM
An update for anyone reading this topic.
We've decided to create custom tables* and filter it using advanced reference qualifiers.
*If you're planning to do the same, check your licensing before.
Kindly,
Natasha Machado.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2018 07:54 AM
Hi,
I did something similar in the past, I've found very useful the procedure described below, feel free to try!
ServiceNow Choice List Dependencies
Hope this will fit your need.
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.
Thank you
Cheers
Alberto

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2018 11:42 PM
Any update on this?
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.
Thank you
Cheers
Alberto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2021 12:26 PM
this seemed interesting, the example appears to rely on custom tables, can the approach be used on choice variables just added to Select box or other variable types (checkboxes etc) ?
if so, advisement on the code tweaking would be welcomed!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2021 02:54 AM
This can also be achieved by using the client script functions like g_form.addOption() and g_form.removeOption() and g_form.clearOptions().
While using these, make sure to add the label as well as index along with Value.
Ex: Use
g_form.addOption('environment', 'DEV', 'DEV', 100);
g_form.addOption('environment', 'TEST', 'TEST', 200);
g_form.addOption('environment', 'PROD, 'PROD', 300);
Instead of
g_form.addOption('environment', 'DEV');
g_form.addOption('environment', 'TEST');
g_form.addOption('environment', 'PROD');