HotDocs Author WorkflowCreate a template Add placeholders Group variables in dialogs Upload a template Create a script

COUNTER Function

The COUNTER function provides you with the current repetition number of a repeated dialog.

The difference between the COUNT function and the COUNTER function is that COUNT counts the number of repetitions in a list, while COUNTER gives you the number (index) of the current repetition.

The COUNTER function provides you with the number of the current repetition of a repeated dialog and you may find useful when performing certain tasks such as creating numbered lists. The COUNTER value increases by one each time a repetition is added to the dialog.

Example

Consider a template that collects information about dependents in a repeated dialog (Dependents), enabling your template users to add information for each repetition for each dependent. If you wanted to list the dependents' names (Dependent Name) in a numbered list, it might look something like the following:

[REPEAT Dependents]
[COUNTER]. [Dependent Name]
[END REPEAT]

Embedding the above code into the face of the template would result in an output document that would look something like this:

  1. John
  2. Emily
  3. Sam