- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:35 PM - edited 02-20-2024 07:37 PM
I have been trying to hide specific values on a select box if Cloud is selected. I searched the community and found several posts regarding this however when i try to replicate i fail. Can you please help me determine where I'm messing up?
The value for field 1 is 'type_of_environment'
The value for field 2 is 'database_type'
if The value 'Cloud' is selected for field 1 then it should remove the choices in field 2 with the value of 'EMR' and 'SnowFlake'
ive also tried a UI policy as well with no luck.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:47 PM
If you're using catalog item on the portal, let try to change the UI Type like below.
And your script could be like
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'Cloud') {
//g_form.clearOptions('type_of_environment'); //not sure about this line.
g_form.removeOption('database_type', 'SnowFlake');
g_form.removeOption('database_type', 'EMR');
}else{
//params: variable name, choice value, choice label
g_form.addOption('database_type', 'SnowFlake', 'SnowFlake');
g_form.addOption('database_type', 'EMR', 'EMR');
}
}
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:47 PM
If you're using catalog item on the portal, let try to change the UI Type like below.
And your script could be like
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'Cloud') {
//g_form.clearOptions('type_of_environment'); //not sure about this line.
g_form.removeOption('database_type', 'SnowFlake');
g_form.removeOption('database_type', 'EMR');
}else{
//params: variable name, choice value, choice label
g_form.addOption('database_type', 'SnowFlake', 'SnowFlake');
g_form.addOption('database_type', 'EMR', 'EMR');
}
}
Cheers,
Tai Vu