- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2014 02:28 PM
Hi Matt,
When variables are grouped together they are called variable sets. variable sets are reusable. They can be used across different catalog items. However normal variable belong to that specific item only. Following is the link.
Service Catalog Variable Sets - ServiceNow Wiki
Regarding Dependent choice list, you can use simple client script based.
You will need following things:
On change of category
function onChange(control, oldValue, newValue, isLoading) {
if(newValue == oldValue){
return;
}
//remove all items from subcat drop down to start
// Used the g_form.clearOptions() function instead of g_form.removeOption() function
g_form.clearOptions('subcat');
//build a new list of dependent options
var gp = new GlideRecord('sys_choice');
gp.addQuery('dependent_value', newValue);
gp.addQuery('element', 'subcategory');
gp.query();
while(gp.next()){
g_form.addOption('subcat', gp.value, gp.label);
}
}
Additional OnLoad script to initially clear the Subcategory
function onLoad (control, oldValue, newValue, isLoading) {
// Used the g_form.clearOptions() function instead of g_form.removeOption() function
g_form.clearOptions('subcat');
}