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.

Check case sensitive in addQuery filter condition

sana11
Kilo Guru

Hi All,

I have a reference field in my catalog form, on choosing of values fetching data from another table. Here I have duplicate names for some records but case sensitive is different. So I just want to get result data only to the name which I passed.

For example.

var gr= new GlideRecord('location');

gr.addQuery('country','INdia'); //should return exact results of INdia not india,INDIA and whatever is available in table.

gr.Query();

 

Can anyone suggest some ideas ?

Thanks!

 

 

 

 

14 REPLIES 14

what will matches = filter.match(currentRecord, true); do here? Because I just tried only with  filter.setCaseSensitive(true);

GlideRecord queries are not case sensitive.  You have to add another check like GildeFilter as you suggest below.

Recently ran into this same issue when GlideRecord would match these two:

KnvZfZ7vAde

KnvZfZ7vAdE

Hi,

addQuery() is doing a case insensitive search; so you want case sensitive search?

addEncodedQuery() is also case insensitive search

Regards
Ankur

 

 

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

Yea I want case insensitive search. Even I tried with grBS.setCaseSensitive(true); but its not working.

I hope this article will helpful to me ,but am confused with the code .Can you please show me the same for my code?