Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

DOES NOT CONTAIN operator not working with glide record

janindiadoc_1
Tera Expert

I need to exclude some records with with short description that contains "XXX_PRO - ". I added the query condition in the glide record as below. There are so many other conditions where i am not able to add that as an encoded query. I added the below condition to the query, but still its fetching the records with the below text.

gr.addQuery('short_description', 'DOES NOT CONTAIN', 'XXX_PRO -');

7 REPLIES 7

Anshu_Anand_
Kilo Sage

For multiple query you can use encoded query in glide record

For does not contain its:-

 

gr.addEncodedQuery('short_descriptionNOT LIKEXXX_PRO -');

For me it works.

 

If its helpful, please mark answer as correct

Regards,
Anshu

You can add multiple queries in encodedquery

 

gr.addEncodedQuery('short_descriptionNOT LIKEXXX_PRO -^number!=INC0005505^ORnumber=NULL^state=2^assignment_group=8a5055c9c61122780043563ef53438e3');
Regards,
Anshu

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

use addEncodedQuery() and not addQuery()

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Thanks Ankur. Will encoded query work along with other addquery() conditions.