Siebel Service Handheld Guide > Print Tagging Language > Data Manipulation and Logic Tags >
Conditional Tags
The conditional tag compares a variable against a criterion according to the operator, and decides to execute either an IF or an ELSE clause. Usage
Use conditional tags to develop simple if-then logic to control the output of your print data. It is recommended that if-then-else tags are kept simple to ensure that print output is successful. Syntax
<TAG:IF variable="VARIABLE NAME" operator="OPERATOR" criteria="CRITERIA" numeric= "NUMERIC"> <TAG:...> <TAG:...> <TAG:ELSE> <TAG:...> <TAG:...> NOTE: If the comparison is true, the tags immediately following the <TAG:IF...> tag are executed; if the comparison is false, the tags immediately following the <TAG:ELSE...> tag are executed.
|
|
TAG:IF |
(Required) Applet tag indicator. |
TAG:ELSE |
(Required) Applet tag indicator |
variable |
(Required) Name of the variable being compared. |
criteria |
String value to which the variable will be compared. |
operator |
(Required) This can be one of the following:
- EQ signifies Equal to
- GT signifies Greater than
- GE signifies Greater than or equal to
- LT signifies Less than
- LE signifies Less than or equal to
|
numeric |
Specifies whether the condition is evaluated as a numeric comparison or a string comparison. Valid values are TRUE (numeric comparison) or FALSE (string comparison). For a string comparison, use the vertical bar (|) as an OR operator. |
Example
The following example evaluates whether the variable numrows is equal to 15, 17, or 19:
- If true, then a string similar to the following is printed: Printed [numrows] rows that are odd
- If false, then a string similar to the following is printed: Printed [numrows] rows that are even
<TAG:IF variable="numrows" operator="EQ" criteria="15|17|19"> <TAG:Concat variable="numrows" append=" rows." prepend="Printed "> <TAG:Concat variable="numrows" append=" that are odd."> <TAG:ELSE> <TAG:Concat variable="numrows" append=" rows." prepend="Printed "> <TAG:Concat variable="numrows" append=" that are even."> <TAG:ENDIF>
|