addQuery() Operators
- Used to search the database for matching records
Must be in quotes
myObj.addQuery('priority', '!=', 1); myObj.addQuery('word_notes', 'CONTAINS', 'Fixed');
In the absence of an operator, method assumes condition to test is equality
myObj.addQuery('category', 'Hardware');
Is the same as
myObj.addQuery('category', '=', 'Hardware');
Numeric comparison operators:
> field must be greater than the value supplied.
>= field must be equal or greater than the value supplied.
< field must be less than the value supplied.
<= field must be equal or less than the value supplied.
String comparison operators:
STARTSWITH - field value must start with the value supplied.
ENDSWITH - field value must end with the value supplied.
CONTAINS - field value must contain the value supplied somewhere in the text.
DOES NOT CONTAIN - field value must not have the value supplied anywhere in the text.
Both numeric and string comparison operators:
= field must be equal to the value supplied.
!= field must not equal to the value supplied.
See ServiceNow's Product Documentation for information on additional operators.