1

I'm trying to write a rule with the following criteria:

IF case.subject CONTAINS "long string with punctuation"
OR
IF case.subject CONTAINS "another long string with more punctuation"
THEN perform action.

I just need to understand how punctuation affects the rule. So if my Workflow Rule reads:

Case.Subject CONTAINS I have a dog named "Fido", who was big and strong [I hate the name Fido].

I'm just trying to determine how that string is going to be interpreted. Do I need to escape certain characters?

1

It's basically the same as CSV rules. If the first character is a quote character, and the last is, then the value is quoted, so you'd have to double them up. Also, commas separate values as an "or" operator. For example:

Name EQUALS John,Jane

Is the same as:

Name EQUALS John OR
Name EQUALS Jane

However, commas are okay if you use quotes:

Name EQUALS "John, Jane"

This is not the same as the previous example, but instead is looking for someone named "John, Jane" (presumably, Jane's parents wanted their name to be as generic as possible).

These are the same rules that are applied to filters everywhere in the system (list views, reports, workflow rules, criteria-based sharing, and so on). It'd probably be easier to use a formula if you need to use punctuation, as that follows a more literal programming structure (but you still need to escape internal quotes).

You'll want to see this help topic as well:

Separate search terms by commas to filter by more than one value. For example, to search for accounts in California, New York, or Washington, use State contains CA,NY,WA.

Filtering isn't case sensitive. For example, searching State contains ID returns all matches for “ID”, but also returns any instances of “Florida” and “Idaho” because they contain “id” in their names.

When you filter on standard long text area fields, such as Description or Solution Details, only the first 1000 characters of the field are searched for matches in reports. Reports can’t be filtered on custom long text area fields. Only the first 255 characters are shown for custom long text area fields in list views.

If entering a date, use the format allowed by your Locale setting. You can also use special date values like TODAY, NEXT WEEK, NEXT YEAR, LAST DAYS, and so on.

Place quotation marks around numbers or other data that includes commas. For example Amount equals "10,000" returns records that have an amount of $10,000 but Amount equals 10,000 returns $10,000 as well as $10 and $0.

To search for phone numbers, include the exact phone number formatting or example, Phone starts with (561).

When filtering on multi-select picklist fields, use a semicolon between values to specify an exact match. [...] For example, selecting the “equals” operator and a semicolon between two values includes records with both values specified, excluding all other values.

When you use the “less than,” "greater than,” “less or equal,” or “greater or equal” operators on fields that have numeric values, records with blank or “null” values are returned as if their value is zero (0). For example, if you create a workflow rule or a lead assignment rule for accounts with the criteria Annual Revenue less than 100000, account records match if their Annual Revenue is blank. [...] However, records with blank field values are not considered matches in report filters, custom list views, and account assignment rules (which assign accounts to territories).

To limit results to records that are blank or contain “null” values for a particular field, choose the field and the “equals” or “not equal to” operators, leaving the third field blank. For example, Amount equals returns records with blank amount fields. You can search for blank values or other specified values at the same time. For example, Amount equals 1,,2 returns records where the Amount is blank or contains the value “1” or “2”.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.