Skip Navigation
Expand
Using 'OR' logic with business rules
Answer ID 84   |   Last Review Date 07/22/2019

Can I use OR functionality for menu items when I create business rules for incidents?

Environment:

Business Rules
Oracle Service Cloud

Resolution:

You can create rules that use OR criteria within the rule. This includes both selecting multiple items from a drop-down menu (product 1 OR product 2 OR product 5) and specifying an OR relationship between two separate fields entirely, such as if the incident contains specific text in the summary OR if the incident is assigned to category 3.


Multiple Criteria for Drop-down Menus

You can create rules that allow for multiple criteria when using a menu field in the IF part of the rule. This allows you to route or escalate records for multiple items listed within the specific drop-down menu options. For example, you could set up a rule to route Ask a Question incidents to a particular group if the submittal was set to category 1 OR category 2 OR category 5.

When setting up the rule, click the Add Condition Based On button and select the appropriate field. A box listing all menu options appears. Use the Control key to select multiple items or the Shift key to select a range of items.

If using the product or category field, check the appropriate boxes to set the criteria of interest. If you have sub-products or sub-categories defined, you can expand the sub-items to select specific values individually.


Between Individual Criteria Listed

You can also define OR criteria between the individual criteria listed in the IF part of the rule using the Logical Expression field.

Note: Logical expressions are also used with custom reports. For more information on logical expressions, refer to Answer 1041: Using the Logical Expression Feature.

For example, you might want to route incidents to a specific group if the product field is set to Product A OR if the category is set to Category 3. To do this you would set up the IF part of the rule as defined below:

IF
1. Incident.Product equals Product A
2. Incident.Category equals Category 3

Logical Expression: 1 | 2

Use of Parentheses

Within the logical expression string, the use of parentheses is very important. If no parentheses are included, the criteria are evaluated solely by the order listed in the Logical Expression box. For example, there is a significant difference between expressions A and B below:

Expression A: 1 & (2 | 3)
Expression B: 1 & 2 | 3


Without parentheses, comparisons are made strictly by the order the criteria are listed. As a result, the expression 1 & 2 | 3 corresponds to (1 & 2) | 3.

  • With expression A, an item matches if criteria 1 is met AND either criteria 2 or 3 is met.  No matter what, criteria 1 must be met. 

  • With expression B, an item matches if criteria 1 and 2 are met OR if criteria 3 is met. If criteria 3 is met, it does not matter if 1 or 2 are met.

That is, the first comparison determines incidents that meet criteria 1 and criteria 2 (that is, incidents assigned to Product A and Category 1). Then the second comparison is made -- OR criteria 3 (that is, incidents assigned to Category 2). Without parentheses, incidents assigned to Product A and Category 1 meet the criteria, and all incidents assigned to Category 2 also meet the criteria. In this case, the report would list all incidents assigned to Product A and Category 1 along with all incidents assigned to Category 2 (regardless of product).


For additional information, refer to the 'Business Rule Logical Expressions' section in online documentation for the version your site is currently running. To access Oracle Service Cloud manuals and documentation online, refer to the Documentation for Oracle Service Cloud Products.

Available Languages for this Answer:

Notify Me
The page will refresh upon submission. Any pending input will be lost.