
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2019 07:44 AM
I have 2 variables on Catalog item
Category
Sub-Category
Category:
Type = "Select Box" , choice table = "cmdb_ci_appl", choice field = "Category"
Sub-Category:
Type = "Select Box" , choice table = "cmdb_ci_appl", choice field = "SubCategory"
In table cmdb_ci_appl, SubCategory is dependant on Category.
Similarly, in Catalog item, how to make SubCategory variable dependant on Category variable?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2019 08:45 AM
For this solution, you can change your variables to be Lookup Select Box types instead of Select Box. This way we can set the attributes on those variables to look up from the cmdb_ci_appl table. For this example, the names of the variables are category and subcategory respectfully. Here are the changes you need to make to your variables:
Category [category]
Type: Lookup Select Box
Lookup from table: Application [cmdb_ci_appl]
Lookup value field: Category
Lookup label field(s):
Include none: true
Unique values only: true
Reference qualifier:
Subcategory [subcategory]
Type: Lookup Select Box
Lookup from table: Application [cmdb_ci_appl]
Lookup value field: Category
Lookup label field(s):
Include none: true
Reference qualifier: javascript: 'category=' + current.variables.category;
Variable attributes: ref_qual_elements=category

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2019 08:06 AM
Hi,
Dependent is not possible in service catalog.
You can write onchange catalog client script on field category.
get the choices dependeds on category .
once you have choices you set using g_form.addOption
Regards,
Harish Murikinati.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2019 08:45 AM
For this solution, you can change your variables to be Lookup Select Box types instead of Select Box. This way we can set the attributes on those variables to look up from the cmdb_ci_appl table. For this example, the names of the variables are category and subcategory respectfully. Here are the changes you need to make to your variables:
Category [category]
Type: Lookup Select Box
Lookup from table: Application [cmdb_ci_appl]
Lookup value field: Category
Lookup label field(s):
Include none: true
Unique values only: true
Reference qualifier:
Subcategory [subcategory]
Type: Lookup Select Box
Lookup from table: Application [cmdb_ci_appl]
Lookup value field: Category
Lookup label field(s):
Include none: true
Reference qualifier: javascript: 'category=' + current.variables.category;
Variable attributes: ref_qual_elements=category

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2019 09:52 AM
Perfect !!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2019 10:15 AM
If it works, be sure to mark it as correct so that others can leverage the same solution.