Applying conditions
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.
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:
- Click in the area to the left or right of the block area, which is then highlighted with shading as shown below:
- At the top, click the Logic tab:
- Click the Add rule button:
- 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:
Applying conditions to variables
To apply conditions to variables:
- When you have added a variable, click it. The following screen is displayed (this example uses the System Field Current Day):
- Click the Logic tab:Note: For some variable types, there is no Setup tab and the Logic tab is at the left.
- Click the Add rule button:
- 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:
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.About rules
A condition can contain one or more rules, such as:
- If vertical Does Not Equal healthcare
- If state Equals Washington
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 (). You can then edit the condition as appropriate.