DOES NOT START WITH filter

Anish Reghu
Kilo Sage

Dear all,

This was asked 5 years ago, unanswered. Asking it again to a much wider audience now, hopefully.

Can someone suggest that script include for DOES NOT START WITH and how to call that from a advanced filter? Please don't refer me to threads, even the thread marked as RESOLVED does not have the solution in it. Any help is appreciated.

I know one solution is to create a advanced filter and calling a script include. But I would need the solution instead of the approach.

Any answers?

 

Regards,

Anish

1 ACCEPTED SOLUTION

Filip Vojt__ek
Giga Guru

Hi Anish,

 

it's a while ago, but maybe someone will find this answer helpfull.

 

The solution from my point of view is to use SQL 'LIKE' operator which work even though it's not documented for GlideRecord:

gr.addQuery('name', 'NOT LIKE', 'StartString%');

 

Pls mark as helpful if solution works.

View solution in original post

21 REPLIES 21

Hi

After offering a few workarounds above, I think to short a neat answer to your question is: "NO, there does not exist a 'DOES NOT START WITH'" filter condition yet.

Even if my proposed solution works, it may become a bit "un-handy" in real-life scenarios.

So, to close this thread, I suggest going to the idea portal and search, if there is already the idea raised for that. If yes, support it, if NO, just feel free to raise your idea about that there, and let us know here. I will support you with that idea.

To close this thread, please mark the best matching answer as correct, so that others can benefit from the outcome.

Thanks a lot and

Enjoy ServiceNow.

BR

Dirk

DirkRedeker
Mega Sage

Hi

Do you have an update on this question? Were you able to sort it out?
If you were able to solve your issue, just let me know and mark the best answer as correct and helpful.
This will close this thread and help others to benefit from the outcome.

Thanks & BR
Dirk

Filip Vojt__ek
Giga Guru

Hi Anish,

 

it's a while ago, but maybe someone will find this answer helpfull.

 

The solution from my point of view is to use SQL 'LIKE' operator which work even though it's not documented for GlideRecord:

gr.addQuery('name', 'NOT LIKE', 'StartString%');

 

Pls mark as helpful if solution works.

Coincidentally I found the same as solution today on another forum. Thanks for responding.

Not applicable

Anish, what was that solution??