Applying conditions

Note: Conditions only apply to Email and Document communications.

Using conditions you can choose whether or not blocks of text, images or links (any HTML element) are displayed, depending on the setting of custom or system fields. Custom fields must be defined in your data source.

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

You can also apply conditions to individual text and to variable fields.

For a further explanation of dealing with conditions, see the following video:

Note: This video only describes how to apply conditions to blocks; it does not cover applying conditions to text within blocks or 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 blue shading as shown below:

  2. At the bottom of the Layout area to the right, select the checkbox Only show this section to certain recipients:

  3. Click the + Add Conditions button:

  4. By default, the Basic rules dialog is displayed. For information on how to create rules, including the use of the Advanced dialog, see About rules.

When a block has conditions applied, it is marked with a small orange symbol at the right, as shown below:

Applying conditions to text or variables

You can apply a condition to an individual piece of text (word, phrase or sentence) and also to variables.

To apply conditions to text or variables:

  1. At the position in the text where you want to insert a conditional item, select Add conditional text from the Add personalization dropdown:

  2. The Insert Conditional Text dialog is displayed:

  3. Enter the text to be displayed. If you want to enter a variable field (either a system field or a custom field), enter the field name surrounded by double curly brackets, for example {{first_name}}. A custom field must exist in the selected data source. After entering the text or field, click Insert Conditional text. The conditional text or variable is displayed with a box around it:

  4. You have added the conditional text or field, but you have not yet applied any conditions to it. To apply conditions, click on the box. The Conditioned Text dialog is displayed:

  5. To apply conditions, select the box Only show this to certain recipients:

  6. Click the + Add Conditions button.

  7. By default, the Basic rules dialog is displayed. For information on how to create rules, including the use of the Advanced dialog, see About rules.

When a piece of text or a field has conditions applied, it is enclosed within a dashed red line, as shown below:

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 Conditions 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 contains 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 All option) or is it sufficient for the data to match just one of the rules (the Any option).
Table 1. Matching All or Any rules in the condition
All 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 then the element will be excluded. This is the equivalent of saying:

If vertical Does Not Equal healthcare AND If state Equals Washington

Any 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

Use the Advanced option if you need a more complex combination of rules such as:

If vertical equals healthcare OR If vertical equals insurance

AND

If status equals new

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 pain, 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 (). You can then edit the condition as appropriate.