Scenario: Creating conditions and lists

Conditions enable you to define what content gets included at correspondence creation time, based on the supplied data. The condition is described in terms of control variables. The variables can be either a data dictionary element or a placeholder.

Conditions have a single output based on an expression. The first expression is found to be true, based on current condition variable. Its value becomes the condition's output. When filling the letter (in Document Composer), conditions behave as "white boxes". If a condition results in a list, all of the list's mandatory and pre-selected items are output. If any of those items are conditions or lists themselves, their resulting content is output as well, in top-down, depth-first order as a flat list of text and image content. Condition results can be of any type (text, image, list, condition).

Lists have multiple output. When filling the letter, individual list items are fully editable (they can be selected, deselected, edited, and so on, based on properties set when the list was created in the List Editor). Lists can also be open, to permit any extra content from the Library not explicitly assigned to the list when the list was authored in the List Editor. Lists basically behave as nestable targets within targets. You can nest lists within lists as well. List items can be of any type (text, image, list, condition).

Implementation overview

Implementing conditions

Conditions can be created with control variables. These control variables can be either a custom variable or from the data dictionary.

When you add a condition, you can choose to include an asset based on the value that the control variable has. If the control variable can have multiple values, then add as many condition rows as there are possible values.

The Condition Editor comes with an Expression Builder user interface that supports creating expressions using both multiple placeholders and Data Dictionary elements. You can use common operands and local / global functions in such expressions. Each expression can be associated with some content and optionally there could be a default section if none of the expressions evaluates to true. All expressions are evaluated in the sequence in which they are defined and the first expressions returning true is selected and its associated content is returned by that conditional module.

For example, if the terms and conditions text in a letter differs depending which state the customer is in, and the data dictionary contains an element called “state”, then you could add the condition as follows:

  • state = NY, select T&C_NY text paragraph

  • state = NC, select T&C_NC text paragraph

The Condition editor enables you to specify a default condition. If the value of the control variables does not match any of the conditions, then the content associated with the default condition is used. Following the previous example, you could add this condition row:

  • Default, select T&C_Rest

Implementing lists

Implementing lists consists of two steps:

  • Defining core properties such as name, description, category, data dictionary, and so on.

  • Section of content that is part of the list, and then setting properties such as lock order and library access for the list.

Protecting and Unprotecting DDEs

Within the Condition Editor, click Add expression to launch the Expression Builder where you can select a Control Variable from a data dictionary or create a placeholder. A control variable can be bound to a data dictionary element which is protected by default. A control variable bound to data dictionary element or a data dictionary variable, can be marked protected or unprotected. To unprotect the variable deselecting the protected selection next to the control variable name. When this condition is used inside a letter and rendered during correspondence creation you can only modify the default value of unprotected control variables which are bound to data dictionary elements. Protected control variables cannot be modified.

Tools used

List and conditions are created using the Manage Assets user interface. For details, see Working with lists and Working with conditions.

Team members

The Application Specialist creates lists and conditions.

Best practices/tips and tricks

  • Add the condition prefix to the assets of this type along with the letter name.

  • Conditions behave like case statements, so order of condition is important. The first match is returned.

  • Use a consistent naming convention to avoid duplication.

  • Use appropriate data dictionary binding

  • The following rules apply when using the Condition Editor when changing to a condition:
    • Addition of variable: Allowed

    • Removal of variable: Allowed

    • Update of properties: Allowed

    • Change of data dictionary: Allowed until data dictionary element is not used. You cannot change the data dictionary on update.

  • The following rules apply when using the List Editor to when changing to a list:
    • Update of properties: Allowed

    • Change of data dictionary: Allowed until no item that uses the data dictionary is associated with it. You cannot change the data dictionary on update.

// Ethnio survey code removed