Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

How to query glide list

Raghu9
Kilo Expert

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.

7 REPLIES 7

JerryJ071847183
Tera Sage

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

Alikutty A
Tera Sage

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!

 

Hi,

Thank you for your response.

But when I am trying with this it is not returning groups whose type is empty.

 

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);
}