{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":987,"path":"api-reference/server-api-reference/c_CriteriaEvaluatorAPI.md","title":"CriteriaEvaluator - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# CriteriaEvaluator- Global\n\nThe CriteriaEvaluator script include provides methods to implement a general-purpose criteria evaluator.\n\nThe general use pattern is to construct the class, add as many criteria as needed, then evaluate.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## CriteriaEvaluator - addCriterion\\(String lhComparand, String operator, String rhComparand\\)\n\nAdds the criteria to be evaluated.\n\n|Name|Type|Description|\n|----|----|-----------|\n|lhComparand|String|The left hand comparand. Must be a named value in the left hand values input into evaluate\\(\\).|\n|operator|String|The operator. Must be one of: equals, starts with, contains, does not contain, ends with, or regex matches.|\n|rhComparand|String|The right hand comparand. Can be evaluated either as one of the right hand values input to evaluate\\(\\) or as a literal string.|\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## CriteriaEvaluator - evaluate\\(Object lhValues, String rhValues, Boolean any\\)\n\nEvaluates the criteria.\n\n|Name|Type|Description|\n|----|----|-----------|\n|lhValues|Object|A hashmap of name-value pairs to evaluate the left hand comparands of the criteria.|\n|rhValues|String|Optional right hand values to use instead of the literal value in evaluating the right hand comparands.|\n|any|Boolean|If true, any criterion matching suffices for a true result. If false, all criteria must match for a true result.|\n\n|Type|Description|\n|----|-----------|\n|Boolean|True if the supplied values satisfy the criteria, false otherwise.|\n\n"}}