Grouping conditions

Besides defining individual conditions in rules, the Administrator of the program can also group the chosen Conditions and create the logical And / Or relationship between them, in the same way, as in the case of bare conditions. Owing to this solution, any clause of grouped conditions can work as a separate unit from other conditions defined within a single rule.

Please note that the particular And / Or relationship type in the case of grouped conditions always applies to the whole group defined above it, e.g. in the following example And applies to the group of both Sender fields and not just the first one from the bottom (Fig. 1.).

Conditions with grouping brackets.
Fig. 1. Conditions with grouping brackets.


The logical relationship between the defined groups of conditions is shown at the bottom of the window in the status area and explains how the conditions will be executed.

To group the conditions, mark the ones you want to group and hit the ER Pro 2.x - conditions grouping button button (Fig. 2.).

Grouping conditions.
Fig. 2. Grouping conditions.

On the other hand, to remove the grouping brackets from selected conditions, mark them and use the ER Pro 2.x - remove conditions grouping icon button.

By skillfully using conditions and grouping, you may define practically endless ways to define conditions for rules.

Please note that you may use grouping brackets to nest the groups of conditions within one another (Fig. 3.). Although such a possibility exists, we recommend staying open minded while grouping and nesting the groups of conditions.

Nested groups of conditions.
Fig. 3. Nested groups of conditions.

Example of usage

To get a better understanding of the grouping feature, please take a look at the example below.

Let's assume that we want to add a promo footer to messages sent from the Marketing Department to all external email addresses:

Two conditions added.
Fig. 4. Two conditions added.

To make the expression more complex we decide that the footer will be added only if the two first conditions from the top (Sender and Recipient) are true and the subject of a message contains phrases: "Offer" or "Newsletter".

Adding additional conditions.
Fig. 5. Adding additional conditions.

However, the outcome of such a composition is not what we've meant. According to the order of executing logical conditions, our expression will be true if the "Newsletter" phrase is found in the subject independently from other defined conditions. Let's see the order of execution by using brackets:

(Sender belongs to the Marketing Group, And the Recipient is external And the subject of the message contains phrase "Offer")
Or (the subject of the message contains phrase "Newsletter")

The expression we wanted to have was:

(Sender belongs to the Marketing Group And the Recipient is external) 
And (the subject of the message contains phrase "Offer", Or the subject of the message contains phrase "Newsletter")

We can achieve such outcome by grouping the conditions with brackets:

Grouping conditions.
Fig. 6. Grouping conditions.

As we can nest the conditions within one another, we can make another step forward with our expression. We will redefine the conditions to add a promo footer to messages sent by the Marketing Department to:

  1. External email addresses if the subject of the message contains "Offer" or "Newsletter" phrase.
  2. Employees (Internal email addresses) if the subject contains the phrase "Promo".

Finally, our redesigned expression will look like this:

Adding additional grouping brackets to conditions.
Fig. 7. Adding additional grouping brackets to conditions.

In this article

Was this information useful?