Counting the Number of Entries in a List

You can use a computation script to determine how many times a user answers a repeated dialog. You can also use a built-in Number variable that numbers a list of answers automatically.

To determine the number of entries in a list

  1. Create a Computation variable containing the expression COUNT( DIALOG ).
  2. Replace the DIALOG placeholder with the name of the repeated dialog.
  3. Optionally, insert this Computation variable wherever you want the number of entries to appear.

You don't have to insert the Computation variable in the template. Often, template developers use the COUNT( DIALOG ) expression as a way to keep track of the number of answers, without ever inserting the actual number in the template, by referencing it in other computation variables.

To number a list automatically

  1. At the template, position your cursor before the variable in the list you want to number.
  2. Insert a Number variable. Instead of typing a variable name, however, click the Variable drop-down button and select COUNTER.
  3. Click OK.
  4. Add any punctuation or spaces you want to go with the number. For example:

The children are listed, as follows:

«REPEAT Children’s Names»

«COUNTER». «Name of Child», «Age of Child»