Step 4 of the HotDocs Author workflow: Create regions and rules

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

  1. Open or create a template.
  2. Highlight the content you want to make conditional.
  3. In the HotDocs Field Editor, in the Action list, click Create a conditional region icon Create a conditional region.
  4. Under Condition Type, choose a Variable (True/False, Single Select, Multi Select, Number, Date, or Text) or Computed Value (Computation or Expression)
  5. 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).

  1. 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.   

  1. In the value box, type a value.
  2. 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

  1. Open or create a template.
  2. Highlight the text you want to make conditional.
  3. In the HotDocs Field Editor, under Action, click Create a conditional region icon Create a conditional region.
  4. Under condition type, under Computed values, click Computation icon Expression.
  5. 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.

For example, the following is an expression that tests three different conditions: 1) the client must be married, 2) the client must be over age 25, and 3) the client must live in Pennsylvania: Client is Married AND AGE( Client Birth Date ) > 25 AND Client State= "Pennsylvania".

  1. Click Add Field. HotDocs places an IF/END IF instruction pair around your content.

To modify a conditional region

Once you have created a conditional region, you can add ELSE, ELSE IF, or more IF instructions to the region to further customize it. To make the Modify conditional region icon Modify a conditional region option appear in the HotDocs Field Editor, place the cursor in your conditional region, taking care to avoid other placeholders in the region.