IBM Lotus Symphony
|
Conditions are logical expressions that you can use to control the display of fields and sections in your document. Although the following examples apply to fields, they also apply to sections.
You can define conditions for the following field types:
Conditional text: displays text A if the condition is true, or text B if the condition is false.
Hidden text: hides the contents of the field if the condition is true.
Hidden paragraph: hides the paragraph if the condition is true.
The simplest way to define a condition is to type the logical expression directly in a Condition box using the following values:
Value | Description |
---|---|
TRUE | The condition is always met. You can also enter any value not equal to 0 as the conditional text. |
FALSE | The condition is not met. You can also enter the value 0. |
![]() |
If you leave the Condition box empty, the condition is interpreted as not being met. |
When you define a condition, use the same elements for defining a formula, namely comparative operators, mathematical and statistical functions, number formats, variables and constants.
You can use the following types of variables when you define a condition:
Predefined Lotus® Symphony™ variables that use statistics on document properties
Custom variables, that are a created with the "Set variable" field
Variables based on user data
Variables based on the contents of fields
You cannot use internal variables, such as page and chapter numbers, in condition expression.
The following examples use a variable called "x":
Example | Explanation |
---|---|
x == 1 or x EQ 1 | The condition is true if "x" is equal to 1. |
x != 1 or x NEQ 1 | The condition is true if "x" does not equal 1. |
sinx == 0 | The condition is true if "x" is a multiple of pi. |
To use comparative operators with strings, the operands must be bounded by double quotation marks:
Example | Explanation |
---|---|
x == "ABC" or x EQ "ABC" | Checks if variable "x" contains (true) the "ABC" string, or not (false). |
x == "" or x EQ "" or !x or NOT x |
Checks if the variable "x" contains an empty string. |
![]() |
The "equal" comparative operator must be represented by two equal signs (==) in a condition. For example, if you define a variable "x" with the value of 1, you can enter the condition as x==1. |
For example, to hide a paragraph, text, or a section from a user with a specific initial, such as "LM", enter the condition: user_initials=="LM".
The following examples use the Conditional text field, although they can be applied to any fields that can be linked to a condition. The syntax used for conditions is also used for the Hidden text, Hidden paragraph, Any record or Next record fields.
Choose Create - Fields - Others, and then click the Functions tab.
In the Type list, click "Conditional text".
In the Condition box, type "page == 1".
In the Then box, type "There is only one page".
In the Or box, type "There are several pages".
Click Insert, and then click Close.
Choose Create - Fields - Others, and then click the Variables tab.
In the Type list, click "Set Variable".
In the Name box, type "Profit".
In the Value box, type "5000".
Click Insert.
Click the Functions tab, and click "Conditional text" in the Type list.
In the Condition box, type "Profit < 5000".
In the Then box, type "Target is not met".
In the Or box, type "Target is met".
Click Insert.
To edit the contents of the "Profit" variable, double-click the variable field.