Creating and Adding a Conditional Region
A conditional region, which can be made up of IF, ELSE, ELSE IF, and END IF instructions, tells HotDocs to either include or exclude text from a final document, depending on whether the answers a user provides in an interview meet the conditions you establish in the conditional region.
To create a conditional region using a variable or computation
- Open or create a template.
- Highlight the content you want to make conditional.
- In the HotDocs Field Editor, in the Action list, click Create a conditional region.
- Under Condition Type, choose a Variable (True/False, Single Select, Multi Select, Number, Date, or Text) or Computed Value (Computation or Expression)
- Under Field Properties > Rule: Include region when... (the value of computation/the answer for variable/this expression evaluates to TRUE), either click the drop down arrow in the field to select the variable, computation, or expression you want to base your conditional region on, or type the name of a new variable or computation and click the Edit button to create a new component with that name.
When you choose a computation that includes parameters, the HotDocs Field Editor displays fields for the parameters. Parameters work in the computation to provide an end-result value. This end-result value is then compared to the value you type in the value box (step 7).
- Choose a value from the comparison drop-down.
The comparison you choose tells HotDocs how to compare your text in the value field with the user's answer to determine if the answer meets your condition. For example, suppose you want HotDocs to include a conditional paragraph when the user's answer to the text variable Insurance Text contains the word benefits. You would select Insurance Text in the variable drop-down, then select contains from the comparison drop-down, and, finally, type benefits in the value field.
- In the value box, type a value.
- Click Add Field.
HotDocs places an IF/END IF instruction pair around your content.
Now that you have created a conditional region, you can add ELSE, ELSE IF, or more IF instructions to the region to further customize it.
To create a conditional region using an expression
- Open or create a template.
- Highlight the text you want to make conditional.
- In the HotDocs Field Editor, under Action, click Create a conditional region.
- Under condition type, under Computed values, click Expression.
- In the expression field, type an expression script that describes the condition that must be met before HotDocs can include the content in the final document, or click the ... button to open the expression editor and create the expression there.
- Click Add Field. HotDocs places an IF/END IF instruction pair around your content.
Now that you have created a conditional region, you can add ELSE, ELSE IF, or more IF instructions to the region to further customize it.