How to achieve if few subcategory depends to all category in incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2023 12:30 AM
Hi,
I have configured around 30 categories in incident form with dependents subcategory now i got a new requirement
i have 3 subcategory which should be available for all categories so how do i configure and what will be the best approach.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2023 12:32 AM
Hi @Saroj Patel
No direct way, other than adding them manually in all categories again or create a new categories and use 3 sub categories and educate users.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2023 12:39 AM
Hi,
There is an alternative but that will work only on Form View. Not applicable in List View.
Create On Load client script and add Option through script using method:
g_form.addOption('subcategory','choice_value', 'Choice Label');
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2023 12:57 AM
Also you need to write one onChange client script running on change of Category to set your choice every time category changes.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
setTimeout(function() {
g_form.addOption('subcategory', 'choice_value', 'Choice Label');
}, 1000);
}
Need to use setTimeout so that it will set option once depended choices are loaded.
Thanks
Anil Lande