Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Add more criteria to encoded query

purdue
Kilo Sage

Hello,

I need to exclude HR groups to this query please assist.

Thanks,

Chad

Add exclusion of HR Groups Type is Human Resources and Parent is not HRSD.

typeNOT LIKE7a5370019f22120047a2d126c42e705c^parent!=904c25b01b00525c62cb2139b04bcb34

 

To

groupsExclusion: function() {
var groupSysIDs = [];
query = 'sys_idIN' + gs.getProperty("groups.to.exclude");
var group = new GlideRecord('sys_user_group');
group.addEncodedQuery(query);
group.query();
while (group.next()) {
groupSysIDs.push(group.sys_id + "");
}
return groupSysIDs;
},
17 REPLIES 17

Brad Bowman
Kilo Patron
Kilo Patron
query = 'sys_idIN' + gs.getProperty("groups.to.exclude") + '^

typeNOT LIKE7a5370019f22120047a2d126c42e705c^parent!=904c25b01b00525c62cb2139b04bcb34';

Hello,

Unfortunately that does not work.  Thanks for the assistance.

Screenshot 2024-10-16 at 2.35.54 PM.png

Screenshot 2024-10-16 at 2.39.50 PM.png

Screenshot 2024-10-16 at 2.42.05 PM.png

Hello,

Unfortunately that does not work.  Thanks for the assistance.

Screenshot 2024-10-16 at 2.35.54 PM.pngScreenshot 2024-10-16 at 2.39.50 PM.pngScreenshot 2024-10-16 at 2.42.05 PM.png