- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 08:07 AM
Hello, Was wondering if some one could help me with retrieving a list of sub-categories based on their dependent value. Basically I have a catalog item where you pick a category and I want the sub-category list to only show those associated with the category.
Thanks
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 11:14 AM
Hi,
You can try below method
For category
Variable type : lookup select box
Lockup from table : choice (sys_choice)
Lookup value field : value
lookup label field : label
reference qualifier: element=category
if table specific
reference qualifier = name=incident^element=category
For subcategory
Variable type : lookup select box
Lockup from table : choice (sys_choice)
Lookup value field : value
Lookup label field: label
reference qualifier: javascipt:'element=subcategory^dependant_value='+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'
if table specific
reference qualifier = javascript:'name=incident^element=subcategory^+current.variables.'CATALOG ITEM CATEGORY VARIABLE NAME'
variable attributes: ref_qual_elements=CATALOG ITEM CATEGORY VARIABLE NAME
Regards,
Mahesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 08:20 AM
In the advanced qualifier use:
javascript: 'dependent_value='+current.variables.category
I am assuming your variable type is lookup select box referring sys choice table.
Also in subcategory variable in variable attribute column use :
ref_qual_elements=category
Here category is your variable name change it as per your requirement
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 09:08 AM
Thank you for the reply. Just so I understand the Reference Qualifier (javascript:'dependent_value='+current.variables.v_category) and the Variable Attributes (ref_qual_elements=v_category) both are defined in the Sub Category variable? Currently with this it is still pulling all the Sub Categories regardless of the Category that is chosen. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 09:30 AM
Yes it have to be in sub cat variable. Confirm few things.
1. Both cat and subcat are being pulled from choice table.
2. Both variables are lookup select box.
3. Check category variable is returning value/name in lookup fields. And also value / name should be same in sys_choic table.
4.Dependent value in sys choice should have valid category value.
5. Also define element value in sys_choice table and add that to your query using:
javascript:'element=^dependent_value='+current.variables.v_category
Add element you define in sys_choice table.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2022 09:41 AM
Hi,
You should check the table name from your subcategory field in catalog item i.e, Goto Maintain items --> Search Catalog item --> go to variable / variable set tab --> Open the Subcategry variable field and check table name and dependent value. There you can find the details.
I doubt - sys_choice table having an entry and make any custom table or decision table created to achieve this requirement as per your assignment design.
Please mark as correct answer if it helped.
Regards,
Suresh.
Suresh.