- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2017 12:52 PM
function deptFilter() {
var arrayUtil = new ArrayUtil();
var a1 = [];
var gr = new GlideRecord('u_university_approvers_list');
gr.addNotNullQuery('u_department');
gr.query();
while (gr.next()){
a1.push(gr.u_department.name);
}
var strQuery = arrayUtil.unique(a1);
gs.log(strQuery);
return strQuery;
}
Trying to get this to return in a reference qualifier. The gs.log comes back as:
College of Design,College of Communication |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2017 01:09 PM
Hello,
Returning the list of names, you will have to concatenate at the start of string the field for your query, something like:
//replacing line 12 with:
return "nameIN"+strQuery;
you can also return the sys_id's and return a string like:
//replacing line 8 with:
a1.push(gr.getValue('u_department'));
//replacing line 12 with:
return "sys_idIN"+strQuery;
this is because the reference qualifier is expecting values, not display values, so I would suggest using sys_ids;
hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2017 01:07 PM
when you hit the search list for your ref qualifier <the spy glass by it> what options are presented??
there is a script include called "GetMygroups" and getmygroupsadvanced" that does this exact thing you can look at either one <they are script includes> to figure out how they load the ref qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2017 01:09 PM
Hello,
Returning the list of names, you will have to concatenate at the start of string the field for your query, something like:
//replacing line 12 with:
return "nameIN"+strQuery;
you can also return the sys_id's and return a string like:
//replacing line 8 with:
a1.push(gr.getValue('u_department'));
//replacing line 12 with:
return "sys_idIN"+strQuery;
this is because the reference qualifier is expecting values, not display values, so I would suggest using sys_ids;
hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2017 05:40 AM
Thanks Carlos for the help!