- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 06:52 AM
Hello, I am trying to hide a field option based on value selected from another field:
- Hide ePO None option for ANG non-co-located
- If “Type is ANG non-co-located”, hide the “None” option (created in step 2) for the “Which ePO affected?” question. We do not want the user to be able to select “None” as an option for that question which only shows when ANG is non-co-located.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 06:59 AM
the issue with your current approach is that you're trying to manipulate the dropdown options using field.options[i].style.display = 'none', which won’t work reliably in the ServiceNow catalog environment.
use and verify below script thatsimplify your script using the g_form.removeOption() method, which is the recommended approach in ServiceNow for catalog variables:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var epoField = 'which_epo_affected';
g_form.addOption(epoField, 'none', 'None');
if (newValue === 'ANG_non_co_located') {
g_form.removeOption(epoField, 'none');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 06:55 AM
Two solutions :
- Make the field mandatory so that user can't select none and submit the request.
- uncheck the 'include none' checkbox in your variable configuration and create a new choice with name 'None'
so that in your client script you can simply add an if condition and write g_form.removeOption
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
05-12-2025 06:59 AM
the issue with your current approach is that you're trying to manipulate the dropdown options using field.options[i].style.display = 'none', which won’t work reliably in the ServiceNow catalog environment.
use and verify below script thatsimplify your script using the g_form.removeOption() method, which is the recommended approach in ServiceNow for catalog variables:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var epoField = 'which_epo_affected';
g_form.addOption(epoField, 'none', 'None');
if (newValue === 'ANG_non_co_located') {
g_form.removeOption(epoField, 'none');
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 08:22 AM
None still shows after updating the script

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2025 09:05 AM
@DreDay3000 Remove the None option in your question choices list and keep the script as it is.
Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth