Use Conditional Instructions in a Computation Script
Just as you can insert IF instructions and expressions directly in a template, you can use a Computation variable to control conditional text. The computation can be as complicated as it needs to be, as long as it follows the same logic applied when you insert an instruction directly in the template. (See Include or Exclude a Single Version of Text Using a Simple IF Instruction or Expression and Include or Exclude Multiple Versions of Text Using IF and ELSE IF Instructions or Expressions for a reminder.)
The IF instruction keywords (IF EXPRESSION, ELSE IF EXPRESSION, and so forth) are all available at the Instruction models list in the Computation Editor. You can either type the instructions directly in the Script field, or you can drag the models to the Script field and replace the EXPRESSION placeholders with either True/False variables or true/false expressions. (See Use the Script Editor.)
The following is an example of a script that uses conditional logic:
IF State = "Idaho"
Total Price + (Total Price * 0.05) + Shipping
ELSE IF State = "Utah"
Total Price + (Total Price * 0.0625) + Shipping
ELSE
Total Price + Shipping
END IF
In past versions of HotDocs, using END by itself instead of the complete END IF instruction was sufficient. Beginning with 11.1, HotDocs no longer processes the shortened version, and now requires the complete instruction.