Creating a Logic Structure

Creating a Logic Structure

Creating a logic structure is like assembling a jigsaw puzzle. Starting from a When node, you add other nodes, connecting them by dragging and dropping.

Note: The When template starts node is always present in the logic editor, although you do not have to place any logic inside it.

To create a new logic structure:

  1. If you want to begin your structure with When template starts, skip to step 4.

  2. In the left sidebar, from the Events section, select a When node element.

The When node appears on the Logic Editor canvas.

  1. In the When node, from the dropdown list, select the value that you need.

  2. In the left sidebar, from the Logic or Actions section, select a node element that you need.

The selected node appears on the Logic Editor canvas.

  1. By dragging and dropping, connect the node with your When node.

  2. In your node, complete the fields as needed.

  3. If required, repeat steps 4-6.

Event Elements

Event elements (When nodes) are always the beginning of a logic structure because they define the initial trigger for an action.

There are two types of When nodes:

  • When template starts: Triggered when users open a template. A default node that is present in every template.

  • When <QUESTION> changes: Triggered when users change the value of the question you select.

Logic Elements

Logic elements (If nodes) allow you to define conditions for the actions to be triggered. If the conditions are not met, the action does not take place.

Every If node consists of two condition rows.

  • If you complete only the first row, the action is triggered when this condition is met. The second row is optional and can be left empty.

  • If you complete both rows, the action is triggered only when both conditions are met.

Every If node has three fields you can complete. An Asset Picker question has an extra field (see below).

To complete an If node:

  1. In the first field, select a value.

  1. In the second field, select the relevant operator:

  1. The available operators are as follows:
OperatorEffect
=Equal to. The condition is true if the two values are exactly equal.If Q_Offer = 1
Not equal to. The condition is true if the two values are not exactly equal.If Q_Offer ≠ Q_Price
>Greater than. Compares numerical values. The condition is true if the value in the first field is greater than the value in the third field.If Q_Offer > Q_Price
<Less than. Compares numerical values. The condition is true if the value in the first field is less than the value in the third field.If Q_Offer < 3
~Like. Compares text values. The condition is true if the value in the first field is similar to the value in the third field.If Q_Country ~ France
  1. In the third field, enter the ID of the relevant element or the value with which you want to compare the value in the first field.

  2. For an Asset Picker question, there is an extra field that allows for the selection of the specific attribute within the selected asset:

Action Elements

With action elements, you can define what action to trigger when the conditions are met.

There are three types of action elements:

  • Set Element: You can show/hide a Layer, Spread, Element or Expression by setting Visibility to On or Off. You can set an element value such as placing an image in an image element or assigning a particular text question or user attribute to a text element. You can also fill an element with a pre-set color.

  • Set Question: You can show/hide a question by setting its Visibility to On or Off. For a text question, you can set its value to that of another question or a user attribute. For a checkbox question, you can pre-check a checkbox.

  • Set Placeholder: You can set the value of a placeholder element to the value of a selected question or a system attribute.

Copying Logic Nodes

You do not need to manually re-build logic structures that are similar to other ones on the canvas. You can copy single nodes and whole structures and then edit the copy as needed.

To copy a single node:

  1. Select the node you want to copy.

  2. In the top bar, select the "copy" icon.

The copied node appears on the canvas.

Note: When you copy a node, you also copy all the nodes that are below it. If you do not need all the nodes that got copied, you need to delete unnecessary nodes.

To copy a whole structure:

  1. In the structure you want to copy, select the When node.

  2. In the top bar, select the "copy" icon.

The copied node appears on the canvas.

Deleting Logic Nodes

You can delete single nodes and whole structures.

To delete a single node:

  • Select the node you want to delete.

  • In the top bar, select the "delete" icon.

Note: When you delete a node, you also delete all the nodes that are below it.

To delete a whole structure:

  1. In the structure you want to delete, select the When node.

  2. In the top bar, select the "delete" icon.

To delete all nodes on the canvas:

  • In the top bar, select Delete All.

Displaying Quick Logic in the Logic Editor

By default, quick logic parameters are hidden in the Logic Editor. It is easier to edit Quick Logic using the properties pane in the main editor. See 8.2 Quick Logic on page 124.

To display quick logic parameters in the Logic Editor:

  • In the top bar, clear Hide Quick Logic.

All quick logic elements are displayed and show a "lock" icon.

Note: We recommend leaving quick logic nodes locked and not editing them. If you unlock a quick logic node, it removes the automatic association with triggering element (as set on the properties pane) and becomes a piece of custom logic.