Working with Statements

Statements control the logic of an expression.

There are two types of statements:

  • Return statements return a value. In order for a return statement to be valid, the result must match the data type of the property that the expression is being defined for.
  • If statements specify a list of statements to be performed when its condition is true. In order for an If statement to be valid, the result must be a Boolean value. You can use the Else and Else If statements to expand on the condition.

To insert a statement:

  1. From the Statements section of the palette, drag a statement to the editor, or click insert statement and select the statement from the drop down list.

    You can insert a statement anywhere there is a blue arrow in the editor. When you add a statement to the editor, a vertical blue bar is added to the editor to indicate a statement block. You can nest statements within other statements, and each statement is indicated by a blue bar.

  2. Select objects and operators for your expression. After you select an object, you can select that object's attributes or methods. See Working with Objects and Operators
  3. To remove a statement block, click remove statement in the statement block and select Remove

When you begin selecting fields in a statement, the expression term is outlined in red to indicate that it is not valid. You cannot save an expression until all of the statements in the expression are valid, as follows.

  • If statements must evaluate to a Boolean value.
  • Return statements must return the expected data type:
    • For property transformations and derived properties, the expected data type is the data type of the property that is being transformed or derived. See Properties.
    • For custom validations, the expected data type is a Boolean value.