- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 10:31 PM
Hi all,
We have a requirement in Complaints table where once the Category is empty or selected "None", the subcategory shouldn't show any choices except "None" or empty. but OOTB we could see "Question" choice visible in the list of subcategory choices once category is empty or none (refer screenshot below).
Note: Complaints table is extending Case [sn_customerservice_case] table.
Any help where we can bypass this choice and display no choices when Category is selected as empty.
Thanks & Regards,
Sreesh Surendran
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 11:28 PM
something like this in onChange of category
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) return;
if (!newValue || newValue == 'None') {
g_form.clearOptions('subcategory');
g_form.addOption('subcategory', '', '-- None --'); // or whatever your 'None' value/label is
} else {
// Optionally, repopulate subcategory choices based on selected category
// Or allow default behavior if subcategory is dependent
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 10:43 PM - edited 04-22-2025 10:45 PM
The is because the dependent value on the sys_choice record is empty. To bypass this, simply fill in a dummy value in the dependent field on the choice list OR you can make the choice inactive if not required.
Before adding dependent value:
After adding dependent value:
Regards,
Siva
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 11:05 PM
rather than touching the OOTB dependency logic between category and subcategory you can use combination of client script + ui policy
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2025 11:28 PM
something like this in onChange of category
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading) return;
if (!newValue || newValue == 'None') {
g_form.clearOptions('subcategory');
g_form.addOption('subcategory', '', '-- None --'); // or whatever your 'None' value/label is
} else {
// Optionally, repopulate subcategory choices based on selected category
// Or allow default behavior if subcategory is dependent
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2025 04:12 AM
Thanks @Ankur Bawiskar , the solution given worked 🙂