- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 06:47 AM
I have a hardware catalog item.
We have 'Operating System' has a Select Box Variable.
We have 'System Type' has a Select Box Variable.
If RHEL is selected for the Operating System, I need to hide one of the values in System Type.
How can I accomplish this?
Thank you in advance,
Rachel
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 07:18 AM
@rachelconstanti You can choose to create a UI Policy on your catalog item using which you can implement this requirement easily.
In your, UI Policy put a condition Operating System is RHEL using the condition builder.
Check the the script checkbox on your UI Policy
In script tab add following if the condition evaluates to true
function onCondition(){
g_form.removeOption('system_type','<name of the option which needs to be hidden>');
}
use the following script if the condition evaluates to false.
function onCondition(){
g_form.addOption('system_type','<name of the option which needs to be hidden>');
}
Another alternative is to implement this via an OnChange Client script on Operating System variable.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue == 'RHEL') {
g_form.removeOption('system_type', 'name of option to be removed');
}
else{
g_form.addOption('system_type', 'name of option to be added'); //add the option here if the OS is not RHEL
}
}
Between these two approaches I prefer UI Policy approach more.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 09:40 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 10:42 AM
@rachelconstanti Could you please update Execute if false script to as follows.
function onCondition(){
g_form.addOption('system_type','draper_personal','Core Business Use (Draper Personal)');
}
Hope this helps.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 07:18 AM
@rachelconstanti You can choose to create a UI Policy on your catalog item using which you can implement this requirement easily.
In your, UI Policy put a condition Operating System is RHEL using the condition builder.
Check the the script checkbox on your UI Policy
In script tab add following if the condition evaluates to true
function onCondition(){
g_form.removeOption('system_type','<name of the option which needs to be hidden>');
}
use the following script if the condition evaluates to false.
function onCondition(){
g_form.addOption('system_type','<name of the option which needs to be hidden>');
}
Another alternative is to implement this via an OnChange Client script on Operating System variable.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
if (newValue == 'RHEL') {
g_form.removeOption('system_type', 'name of option to be removed');
}
else{
g_form.addOption('system_type', 'name of option to be added'); //add the option here if the OS is not RHEL
}
}
Between these two approaches I prefer UI Policy approach more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 09:25 AM
Thank you!
I also prefer the UI Policy approach.
This worked like a charm 🙂
Rachel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 09:32 AM - edited 10-23-2023 09:41 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2023 09:40 AM