- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 11:27 PM
I am Doing Glide record for one table and there i need to put one query or Encoded Query that the field "Contract_ID" should not starts with string "CW".
Contract_ID is the string field , i only wants the record where contract id is not starting with "CW" i can see in the filter that i have one filter "Starts WIth" but i can not see the filter not Starts with.
Solved! Go to Solution.
- Labels:
-
Connect
-
IntegrationHub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 11:37 PM
Hi Vikas,
Please use the below addQuery condition in your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 11:37 PM
Hi Vikas,
Please use the below addQuery condition in your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 11:38 PM
Hello Vikas,
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.
BR,
Nayan
Best Regards,
Nayan Dhamane
ServiceNow Community Rising Star 2023.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 11:39 PM
Hi
It's true that we do not have any Operator for your requirement but there are some workarounds:
- Check the community article "DOES NOT START WITH filter"
- Or you can go for RegEx in the while loop after you do a GlideRecord Query
In script you can try the below-provided query (but this will not work on the List Filter😞
gr.addEncodedQuery('numberNOT LIKECW%')
Please let me know if you need any help with the code.
Please mark my answer as correct if this solves your issues!
If it helped you in any way then please mark helpful!
Thanks and regards,
Kartik