How to achieve if few subcategory depends to all category in incident form

Saroj Patel
Tera Expert

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.

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

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]

****************************************************************************************************************

Anil Lande
Kilo Patron

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');

 

 

 

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

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.

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande