Client applications use a specific syntax for querying multi-select picklists (in which multiple items can be selected).
The following operators are supported for querying multi-select picklists:
| Operator | Description |
|---|---|
| = | Equals the specified string. |
| != | Does not equal the specified string. |
| includes | Includes (contains) the specified string. |
| excludes | Excludes (does not contain) the specified string. |
A semicolon is used as a special character to specify AND. For example, the following notation means ' AAA' and ' BBB':
'AAA;BBB'
Specifying AND is used for multi-select picklists when two or more items must be selected.
In the following example SOQL notation, the query filters on values in the MSP1__c field that are equal to AAA and BBB selected (exact match):
MSP1__c = 'AAA;BBB'
In the following example SOQL notation:
MSP1__c includes ('AAA;BBB','CCC')
the query filters on values in the MSP1__c field that contains either of these values:
A match will result on any field value that contains 'AAA' and 'BBB' or any field that contains 'CCC'. For example, the following will be matched:
'AAA;BBB'
'AAA;BBB;DDD'
'CCC'
'CCC;EEE'
'AAA;CCC'