8,849
edits
Changes
→Using Conditional Statements
:<font size="3">'''@variable@=if(''conditional statement'',''value if true'',''value if false'');'''</font>
It is recommended to separate out the criteria to avoid issues caused by variable values containing special characters like quotation marks. For example, instead of the following statement...
<pre style="white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;">@level1.Success Criteria Count@=if('@level1.status@' IN ('Draft','Pending'),'@level1.xml.Success Criteria.Criteria.item.nodecount@','@level1.Success Criteria Count@');</pre>
...use the following syntax...
<pre style="white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;">@level1.Success Criteria Count@=if(? IN ('Draft','Pending'),?,?):=:@level1.status@:,:@level1.xml.Success Criteria.Criteria.item.nodecount@:,:@level1.Success Criteria Count@;</pre>
Note that the criteria for the ''if'' statement are first referenced as ''?'' marks, then the ''if'' statement is separated from the criteria values using '':=:'', then the separate criteria values are separated by '':,:''
You can also use the '''Case''' syntax: