The CreatorCon Call for Content is officially open! Get started here.

NOT LIKE doesn't seems to match Empty values

Sidney-
Tera Contributor

Hi everybody,

 

This is regarding querying the REST API.

First of all I know about the ISEMPTY operator but.. I was kind of expecting NOT LIKE to match empty values as well for string values?

I mean if I filter on short_descriptionNOT LIKESQL any short_description that does not have SQL in the name (like an empty one) should match this as well should't it?

 

Anyone have some insights in this?

Thank you.

 

Best regards,

Sidney

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi,

As per OOB configurations ServiceNow operator 'NOT LIKE' ignores empty record values.

If you want to include records with empty values as well then you need to apply query like below:

"short_descriptionNOT LIKESQL^ORshort_descriptionISEMPTY"

 

Your observation/expectation is correct but this is how it is.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

3 REPLIES 3

Anil Lande
Kilo Patron

Hi,

As per OOB configurations ServiceNow operator 'NOT LIKE' ignores empty record values.

If you want to include records with empty values as well then you need to apply query like below:

"short_descriptionNOT LIKESQL^ORshort_descriptionISEMPTY"

 

Your observation/expectation is correct but this is how it is.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Thanks Anil.

I already had the code amended to include that ^OR statement before posting the question but was silently hoping for a different answer hahah.

It is what it is.

Thanks for the time taken to answer.

Have a great day.

 

Best regards,

Sidney

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Sidney- 

 

First of all I know about the ISEMPTY operator

ISempty is like searching for blank value

LearnNGrowAtul_0-1706605630330.png

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************