Filtering a List of Answers

You can create a computation script that filters a list so HotDocs merges  into the assembled document only those entries that meet a particular condition. For example, you can create a list of all the children in a family and then limit the list to include only those who are under the age of 18.

To filter a list

  1. At the template, edit the REPEAT instruction.
  2. Click Show Advanced. The dialog box changes to show sorting and filtering options.
  3. Click the Edit Component button next to the Filter by drop-down list. The Computation Editor appears.
  4. Type a name for the filter in the Variable name field.
  5. In the Script field, type the condition that has to be true for an entry to be included in the list. (The variable in the condition must also be in the repeated dialog.) For example:

Dependent Age <= 17

  1. Click OK to return to the REPEAT Field dialog box.
  2. Optionally, if you've assigned a sorting option and you want the sorting to happen before the filter is applied, select Sort first.
  3. Click OK again to return to the template.

You can make a filter as complicated as you need it to be, but it must result in either true or false. For example, the expression YEARS FROM( Child's Birth Date, TODAY ) produces a number (the age of a person), not a true or false value—it is not a filter. But the expression YEARS FROM( Child's Birth Date, TODAY ) <= 17 can only result in true or false. It can correctly filter all children under the age of 18 from a list.