Dynamically remove reference qualifier onChange script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2026 07:26 AM
Is there a way to remove a reference qualifier acting on a Service Catalog variable when a user changes the value on another variable?
Ex.
Field A (True/False)
Field B (Reference field)
if(Field A changes)
Field B (remove reference qualifier)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2026 07:29 AM
you can use advanced ref qualifier which depends on other variable.
using client script not possible to change reference qualifier
You are ServiceNow employee, you can check internally with the product team if you wish to.
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2026 04:08 AM
Hope you are doing good.
Did my reply answer your question?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2026 07:35 AM - edited 02-13-2026 07:40 AM
You can use an if statement as using the javascript: prefix enables that field to accept JavaScript.
If it's a bit more complex, then you can use a Script Include as well.
So use if statement , it's like:
javascript: var queryVarB; if (current.variables.variable_A = = True) { queryVarB="<encodedQuery1>"; } else { queryVarB="encodedQuery2"; } queryVarB;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2026 05:08 AM
- Field A → True/False (Checkbox)
- Field B → Reference variable
- Requirement:
When Field A changes, remove the reference qualifier on Field B.
Create an onChange Catalog Client Script
- Type: onChange
- Variable name: field_a
- UI Type: All
- Applies to: Catalog Item
