Applying conditions

Note: Conditions only apply to Email, Document and Video communications.

Using conditions you can choose whether or not blocks or variables are displayed, depending on the setting of Custom or System Fields. Custom Fields must be defined in your data source.

For more information about System Fields, in particular the use of Greeting and Title, see Using System Fields.

The way that conditions work is that, if a specified condition is true, the block or variable to which it applies will be displayed; if the condition is not true, it will be hidden.

For a short video clip on applying conditions, see Help videos: Introduction to EngageOne™ Communicate.

Note: This video only describes how to apply conditions to blocks; it does not cover applying conditions to variables.

Applying conditions to blocks

You can apply a condition to a block (HTML element) in a template or communication. The rules in the condition control when the element is included in the communication.

To apply conditions to a block:

  1. Click in the area to the left or right of the block area, which is then highlighted with shading as shown below:

    Highlighted block

  2. At the top, click the Logic tab:

    Logic tab

  3. Click the Add rule button:

    Logic tab with added rule

  4. You can specify one or more rules. The first dropdown lets you select a Data Field or a System Field (the Data Fields available are determined by your Data Source). The second dropdown lets you select an operator (such as Equals or Greater Than). In the Value box, enter the value of the field to which the operator applies. You can use the first + sign to add another rule, and the second + sign to add a new group of rules. For information about rules, see About rules.

When a block has one or more conditions applied, it is marked with a small orange symbol at the right, and a dashed box around the block, as shown below:

Indication that conditions are present

Applying conditions to variables

To apply conditions to variables:

  1. When you have added a variable, click it. The following screen is displayed (this example uses the System Field Current Day):

    Screen showing variable Current Day

  2. Click the Logic tab:

    Logic tab for Current Day field

    Note: For some variable types, there is no Setup tab and the Logic tab is at the left.
  3. Click the Add rule button:

    Rule added

  4. You can specify one or more rules. The first dropdown lets you select a Data Field or a System Field (the Data Fields available are determined by your Data Source). The second dropdown lets you select an operator (such as Equals or Greater Than). In the Value box, enter the value of the field to which the operator applies. You can use the first + sign to add another rule, and the second + sign to add a new group of rules. For information about rules, see About rules.
    Note: The operator Exists evaluates to true whenever the value of the data field is set to any value with length>0 (it evaluates to false for an empty string value). Does Not Exist works the other way around (true for an empty string value).

When a variable has one or more conditions applied, it appears like this:

Variable Current Day shown with conditions applied

Click the symbol at the left to edit the conditions. Click the X at the right to delete the variable; you will be asked for a confirmation because the variable has conditions.

Conditions and data sources

The conditions you can apply depend on the fields in the selected data source. For example, in this condition:

If vertical equals healthcare

vertical is a field in the data source and healthcare is one of the possible values.
Note: Typically you add conditions to a template for a particular data source. However, it is possible for people creating communications from the template to select a different data source. Using the Logic tab, they can modify conditions by selecting different fields and values. The elements and conditions that need to be modified will be highlighted in red.

About rules

A condition can contain one or more rules, such as:

  • If vertical Does Not Equal healthcare
  • If state Equals Washington
Rules can be applied in two ways. Either the data in the record matches all the rules in the condition (the And option) or is it sufficient for the data to match just one of the rules (the Or option).
Table 1. Matching All or Any rules in the condition
And Select this option if you want to include the element in the communication when the data matches all the rules defined in the condition. If the data doesn't match all the rules, the element will be excluded. This is the equivalent of saying:

If vertical Does Not Equal healthcare AND If state Equals Washington

Or Select this option if you want to include the element in the communication when the data matches just one or more of the rules. The element will be excluded if the data doesn't match at least one of the rules. This is the equivalent of saying:If vertical Equals real estate OR If vertical Equals marketing.
Note: This is the inclusive OR operator.

Previewing the conditions

To preview a communication with conditions applied, click Preview and Test. As you click through the data fields in the left hand pane, the preview updates in accordance with the conditions.

Click Close preview to return to the editor.

Duplicating elements with conditions

After applying a condition to an HTML element, you can duplicate it by clicking the Duplicate icon (Duplicate icon). You can then edit the condition as appropriate.