- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 08:49 AM
I want to create a category and subcategory type variables for an catalog item. Where both are select boxes, based on catalogry, options of subcategories are shown.
I want to know the best way to make this solution robust and scalable.
Solved! Go to Solution.
- Labels:
-
Request Management
-
Service Desk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 10:49 AM
Hey @saint ,
As you want to create variables then, it is recommended that create these variables with choice list then for second also created it as choice list, then in second variable related list, you can define the dependancy based on the first variable.
Anytime you can go and add to choice list and specify to which it is dependant.
For reference you can refer to the category and subcategory fields from problem form. This will show you how to create it easily. It is easy to maintain and scalable.
Thanks,
Bhimashankar
----------------------------------------------------------------------------------------
Please mark my answer as helpful/correct if it resolves your query.
----------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:01 AM
Hello @saint ,
You can use catalog client script and in the catalog client script use g_form.addOption() and
g_form.removeOption() methods.
Syntax -
g_form.addOption('variablename','value','optiondisplayvalue',indexnumber); //To add option from the choicelist
g_form.removeOption('variablename','choicelistvalue'); //To remove option from the choicelist
Thank you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 09:17 AM
You can write an OnChange Client script on Category field like below
g_form.clearOptions('sub_category');
if(newValue == 'category_one')
{
g_form.addOption('subcategory', 'value1');
g_form.addOption('subcategory', 'value2');
}
else if(newValue == 'category_two')
{
g_form.addOption('subcategory', 'value3');
g_form.addOption('subcategory', 'value4');
}
Check the field names and values in the script.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2025 10:49 AM
Hey @saint ,
As you want to create variables then, it is recommended that create these variables with choice list then for second also created it as choice list, then in second variable related list, you can define the dependancy based on the first variable.
Anytime you can go and add to choice list and specify to which it is dependant.
For reference you can refer to the category and subcategory fields from problem form. This will show you how to create it easily. It is easy to maintain and scalable.
Thanks,
Bhimashankar
----------------------------------------------------------------------------------------
Please mark my answer as helpful/correct if it resolves your query.
----------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2025 11:22 PM
Hey @saint ,
Please mark as helpful or accept as solution for any reply which solves your issue. It will not only help you but also for future developers. If there any suggestion or stuck anywhere, feel free to post a reply or message me.
You coordination will help community to grow stronger!
Thanks,
Bhimashankar