How to query glide list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2018 04:49 AM
Hi,
I am trying to query a Glide list field in group table.
I am trying to print list of records whose group type is not catalog. Here group type is glide_list.
How to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2018 04:55 AM
Hi,
GO thorugh trhe below link it will give you idea
https://docs.servicenow.com/bundle/london-application-development/page/script/business-rules/reference/r_ReferencingAGlideListFromAScript.html
Mark MY answER AS corRECT AND HELPFUL IF IT HELPED
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2018 05:00 AM
Hello,
You can try this script in background
var group = new GlideRecord("sys_user_group");
group.addEncodedQuery("typeNOT LIKE74af88c6c611227d0066386e74dc853d");
group.query();
while(group.next()){
gs.log(group.name + "-"+ group.manager);
}
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2018 05:22 AM
Hi,
Thank you for your response.
But when I am trying with this it is not returning groups whose type is empty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-20-2018 05:27 AM
Please try this one and let me know
var group = new GlideRecord("sys_user_group");
group.addEncodedQuery("typeISEMPTY^ORtypeNOT LIKE74af88c6c611227d0066386e74dc853d");
group.query();
while(group.next()){
gs.log(group.name + "-"+ group.manager);
}