Only show subcategories that belong to the category selected on Variables

Stacy1
Mega Guru

I have a select box which looks at the categories on a table.  I am setting a default value in that variable.

I have a second select box that is the sub-categories to the category in the first variable.  I want to limit the subcategories based on the category value.  

In both variables I am using the choice table and the choice field.  How do I get only the subcategories related to my category to show up?

Thanks,

Stacy

1 ACCEPTED SOLUTION

Stacy1
Mega Guru

I figured it out.

Since I was setting a default for the category any way, and I only want subcategory associated to that category I did the following:

  1. Change type to 'lookup select box'
  2. Change table to the sys_choice table
  3. Set a reference qualifier with my dependent value (category)

 

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Stacy,

you would require onchange client script on category and accordingly add/remove options from sub-category

you cannot have dependent variable similar to fields on table

if they both refer same table for bringing the choice values; and if there is mapping between those then it can be done using reference qualifier

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Stacy1
Mega Guru

I figured it out.

Since I was setting a default for the category any way, and I only want subcategory associated to that category I did the following:

  1. Change type to 'lookup select box'
  2. Change table to the sys_choice table
  3. Set a reference qualifier with my dependent value (category)