Hide options from Select box variable depending on the option selected from previous select box
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 09:22 PM
My requirement is that i have two select box variables Platform name and work request depending on the selection in variable Platform name, the options in work request should be shown or hidden.
Please advise how to achieve this via client script
Below script implemented but if i change selection multiple times its not working. Please advice where the issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:01 PM
Hi @Krishna Priya,
I would suggests to use advanced reference qualifier to control visibility of options in select box variable instead of Catalog client scripts.
If my response helps you resolve your issue. Kindly mark it as helpful & correct. It will be helpful to future readers! 👍🏻
Thanks,
Sagar Pagar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:03 PM
@Krishna Priya I recommend you using UI Policy with script field checked to achieve this functionality. Let me know if you need any help in creating the UI Policy for this purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2024 06:34 AM
yes please help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2024 10:15 PM
Hello @Krishna Priya ,
Please give a try to the script below and see how it works for you.
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue === '') {
return;
}
var platform = g_form.getValue('Platform_name');
// Clear existing query on 'work_request' variable
g_form.getReference('work_request').clearOptions();
// Set a new query based on the selected 'Platform_name'
if (platform === 'Email') {
g_form.getReference('work_request').addQuery('category', '=', 'Email');
} else if (platform === 'Endpoint') {
g_form.getReference('work_request').addQuery('category', '=', 'Endpoint');
}
}
Let me know your views on this and Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Aniket