Filtering on Special Characters

If you are building a filter expression that is filtering text, and your expression contains special characters, the special character may need to be “escaped” in the filter expression.

The following are the special characters that need to be escaped:

  • * (asterisk)
  • ? (question mark)
  • ‘ (single quote)
  • \ (backslash)
  • " (double quote)

To “escape” a character means to precede that character with another character in the filter expression so that the system knows that you are filtering on the literal character, rather than intending for the character to take on its special meaning. For example, if you just included an asterisk or question mark, it would take on its special meaning as a wild card character (see Using Wild Card Characters).

The character that you precede the special character with depends on what you are filtering (work items, process instances, events, or cases), as shown in the table below (although it is most often a backslash). Also note that some special characters do not required escaping, that is, just include the special character on its own in the filter expression. For example, when filtering cases, a single quote can be included in the expression without escaping it. Also, in some instances, if you include an escape character when it is not needed, or do not include the escape character when it is needed, an error is returned. These are noted in the table below:

Character to match literally Work Items Process Instances Events Cases
* \* \* \* \*
? \? \? \? \?

See footnote (1)

\' '' \‘ '
\ \ \ \\

See footnote (2)

\\

See footnote (2)

" \"

See footnote (3)

" \" "

See footnote (4)

  (1) If you include a single quote in the expression, without escaping it, when filtering work items, process instances, or events, an error is returned.

  (2) If you include a single backslash in the expression, without escaping it, when filtering events or cases, an error is returned.

  (3) If you include a double quote in the expression, without escaping it, when filtering work items, an error is returned.

  (4) If you include a double quote in the expression, that is escaped with a backslash, when filtering cases, an error is returned.

As an example, if you are filtering for events for a resource (Principal name) by the name “Jon O’Reilly”, you would need to escape the single quote in the name with a backslash character. For example: