Trouble Resetting Conditional Subcategory Fields in Service Catalog Item Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 10:44 AM
Hello,
I'm currently developing a Service Catalog form in ServiceNow and have come across a challenge. First off this is a record producer. My form has a field named 'u_request_type' (a drop-down list with choices, one of which is 'AllyDVM Operational Comms') and another field named 'ally_subcategory' (also a drop-down list with multiple choices).
My objective is:
If the user changes the selection in 'u_request_type' away from 'AllyDVM Operational Comms', to another answer, I want the 'ally_subcategory' field to reset back to 'none', meaning it should not retain the previous selection. On the variable form for 'ally_subcategory' under "Type Specifications" I do have the "include none" box checked and --None-- is a selectable option.
To achieve this, I tried implementing a Catalog Client Script. Here's the script I used:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue != 'AllyDVM Operational Comms') {
producer.ally_subcategory = '';
}
}
Despite this, the script doesn't seem to be working as I expected. The 'ally_subcategory' field still holds onto its prior selection when 'u_support_type' is switched away from 'AllyDVM Operational Comms'.
Here are some screenshots.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 11:19 AM
Hi @Sysop ,
There are multiple ways to achieve this. Apart from that simple one is configuring UI policy. Please follow further steps:
- Configure a UI Policy:
- Open your Record producer
- Go to the "Catalog UI Policies" related list.- Click "New" to create a new UI Policy.
- Catalog condition -> u_request_type [is Not] AllyDVM Operational Comms
- Provide a meaningful short description
- Applies on a Catalog Item view = true and Reverse if false = true- In the Script section, make 'Run script = true' and paste the below script in Execute if true field:
function onCondition() {
g_form.setValue('ally_subcategory', '');
}
- Save
If this helped you in any way, please hit the like button/mark it helpful. So it will help others to get the correct solution.
regards,
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 01:34 PM
Prasad,
Thank you for your reply. Unfortunately this did not seem to work. Here are screenshots of your instructions that I followed.
Any ideas on why this doesn't seem to be working would be greatly appreciated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2023 10:54 PM
@Sysop , try making onLoad = false in ui policy. Everything else seems fine 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2023 11:48 AM
Prasad,
That didn't seem to work either. I'm going to open a support ticket with ServiceNow because it does seem like this should be working. Thank you for your help. Anything further you would try?