'Does Not Start With' Operator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2017 03:53 AM
Hi Friends,
I am in process of creating a report on Incident table. Require a suggestion on filter criteria please-
This is the filter criteria below i need to set (along with other simple condtions)-
CIs 'Do not Start With'- SAP , EAS, E1
Assignment Groups 'Do not Start With'- EAS, SAP, DBA, LSG.E1
While there is a 'Starts with' but no 'Does not start with' in ServiceNow. Any experience , thought will be highly appreciated.
Thanks,
Nishant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2017 08:04 AM
did you find the solution for finding not starts with
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2018 12:37 AM
Hi All,
Even i had similar requirement to restrict groups which has some selected prefixes.I have implemented this requirement using before query business rule as below and it works perfect.
(function executeRule(current, previous /*null when async*/) { var group_prefix = gs.getProperty('GroupPrefixes'); // replace with your system property var group_splitted = group_prefix.split(','); var query = 'nameSTARTSWITH'+group_splitted[0]; for(var i=1;i<group_splitted.length;i++){ query = query+"^ORnameSTARTSWITH"+group_splitted[i]; } var final_groups =[]; var allGroups = new GlideRecord('sys_user_group'); allGroups.addEncodedQuery(query); allGroups.query(); while(allGroups.next()){//final_groups.push(allGroups.sys_id); current.addQuery('sys_id','!=',allGroups.sys_id); }
|
Please mark this answer as correct if this helps.
Regards
Anantha Gowraram

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2020 02:25 AM
But this requires the system property to be updated as per the needs, isn't it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-19-2021 05:16 AM
Hi Nishant,
it's a while ago, but maybe someone will find this answer helpfull.
The solution from my point of view is to use 'LIKE' operator which work even though it's not documented:
gr.addQuery('name', 'NOT LIKE', 'SAP%');
gr.addQuery('name', 'NOT LIKE', 'EAS%');
gr.addQuery('name', 'NOT LIKE', 'E1%');
Pls mark as helpful if solution works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2023 08:15 AM
Hi All,
I am trying the same approach to exclude groups that start with ECAB or KNOWLEDGE; it should also exclude groups that have the 'mic' group type. So i have tried with the background script with Not Like operator like below code.