Reference qualifier for catalog variables Call the script include with
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 02:45 AM
I have a catalog item with three variables: employee_company, employee_department and employee_group.
All types are references.
I would like to narrow down the choices for employee_group by the selected results for employee_company and employee_department.
Specifically, perform a query using the Question Choice string selected by employee_company and employee_department.
However, the script include and its calls that I am currently creating are not working well. Furthermore, it is necessary to reflect the selection results of not only employee_company but also employee_department. Please tell me how to improve it.
script include:
Accessible from: All application scopes

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2024 02:50 AM - edited 03-18-2024 02:51 AM
Hi @nakamura323 there is a error in your script include . The backend name of servicenow fields are in lowercase. I added active true to the query, you need to return sysid
GetComNamQuery: function(ComNam) {
var gr = new GlideRecord("sys_user_group");
gr.addQuery('name', 'CONTAINS', ComNam );
gr.addQuery('active','true');
gr.query();
var list=[];
while (gr.next()){
list.push(gr.getValue('sys_id'));
}
return 'sys_idIN' + list.join(',');
},
javascript:new test_IdDepartmentUtil().GetComNamQuery(current.variables.employee_company);
Harish