Following the last blog, Learn CAML Statements Part 1, this blog looks at some of the CAML comparison operators that can be used within Collaborative Application Markup Language (CAML) queries. There are a few not listed i.e. In, Includes, NotIncludes, as these are not supported at present in BrightWork.
CAML Comparison Operators
In the example above, the <Eq> is a comparison operator. It looks to see if one value equals another. There are many different types available in CAML.
NOTE: CAML is case sensitive
Query |
Open |
Close |
Syntax Example |
Details |
Equals | <Eq> | </Eq> |
<Where>
|
Assigned to is equal to ‘John Doe’ |
Not Equals | <Neq> | </Neq> |
<Where>
|
Assigned to is not equal to ‘Me’ i.e. the logged in user |
Greater Than | <Gt> | </Gt> |
<Where>
|
Due Date is greater than ‘2017-06-13’ |
Greater Than or Equal To | <Geq> | </Geq> |
<Where>
|
Due Date is greater than ‘2017-06-14’ |
Less Than | <Lt> | </Lt> |
<Where>
|
PercentComplete is less than 50 |
Less Than or Equal To | <Leq> | </Leq> |
<Where>
|
PercentComplete is less or equal to than 50 |
Is Null | <IsNull> | </IsNull> |
<Where>
|
Assigned to is null / Assigned to contains no value |
Is Not Null | <IsNotNull> | </IsNotNull> |
<Where>
|
Attachment is not null /Item has an attachement |
Contains | <Contains> | </Contains> |
<Where>
|
Status contains ‘Late’ |
Begins With | <BeginsWith> | </BeginsWith> |
<Where>
|
Priortiy begins with ‘(02)’ |
Membership |
<Membership Type = “Text”> |
</Membership> |
<Where>
|
The person listed in ‘AssignedTo’ is a member of the group ‘BrightWork Members’ |