'Does Not Start With' Operator

niitnishant
Tera Contributor

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

10 REPLIES 10

Hi Apoorva D,

I have noticed your reply just now. So sorry for late reply.

You need to add those using AND logical operator like
'Name DOES NOT START with ECAB AND Name DOES NOT START with Knowledge AND Type DOES NOT CONTAIN 704093f22b08224072751cf405da1599'

That should be quite easy to adjust:

var l1 = new GlideRecord('sys_user_group');
l1.addQuery('name', 'NOT LIKE', 'ECAB%')
l1.addQuery('name', 'NOT LIKE', 'Knowledge%');
l1.addQuery('type', 'NOT LIKE', '704093f22b08224072751cf405da1599'); 
l1.addQuery('active', true);
l1.query();
while(l1.next()){
    gs.print(l1.getRowCount());
    gs.print(l1.name);
}