Repeated Dialog Overview
A Repeated Dialog is a type of dialog that a template user can answer multiple times in an interview to create a list of answers.
For example, if you wanted to create a list of a client's children you could use a repeated dialog to allow a template user to enter the details for as many children as needed.
Common Tasks
- Creating a Repeat Dialog Using Component Studio
- Changing the Appearance and Behavior of a Dialog
- Adding Script to a Dialog
Types of repeated dialogs
Series
Appears as a regular dialog to with an answer field for each variable. When the template user has answered the questions in the first iteration of the dialog, they can either click the Add Another button to add another iteration of the dialog, or they can click Next to move to the next dialog in the interview.
Spreadsheet
Appears as a spreadsheet with a column for each variable on the dialog. When the template user has filled in the first row of the spreadsheet, they can either click into the next row to add another iteration of the dialog, or they can click Next to move to the next dialog in the interview.
Repeated Dialogs as Option Sources
Because repeated dialogs enable you to gather a series of answers for each of the variables you place on the dialog, by nature, the answers they gather lend themselves to being accessed as rows of data, just like a Fixed Table component, or a Table variable. Therefore, you can also use a repeated dialog as an option source for a selection variable. In order for this to work however, you need to set a key on the repeated dialog you want to use as an option source.
Repeated Dialogs and Keys
Repeated dialogs enable you include or exclude any variables you add to the dialog as part the dialog's key (using the Contents tab of the Dialog Editor). Doing this enables you to ensure that the template user's answers are unique (i.e., you can keep your template user from providing the same answer twice to the same question).
If you try to designate a repeated dialog as an option source without first declaring a key, HotDocs treats this as an error. Likewise, if you declare a dialog that is not a repeated dialog as an option source, HotDocs treats this as an error.
You can mark the following variable types as a key:
- Text variable
- Number variable
- Date variable
- True/False variable
- Single Select variable (with a simple key)
Repeated Dialogs and Dot Operators
As with other options sources, when you want to access a repeated dialog's values (where HotDocs stores them in the answer set), you use a dot operator (somename.someothername) to do this. Unlike other options sources however, currently, repeated dialogs only allow one level of indirection. That is, you can only access one concrete value, not another row of data stored in another option source (e.g., not another repeated dialog that is the option source for another selection variable). The values you access using the dot operator are limited to the following value types:
Dialog scripts on repeated dialogs
You can add dialog scripts to any type of dialog but for repeated dialogs it's important to remember that the script runs every time the template user adds another iteration.
If you are using a dialog script that runs every time the template user starts a new iteration of the dialog, although you can see an initial blank iteration in the interview outline from the beginning of the interview, that script does not run for the first time until the template user navigates to the initial iteration. Then it runs every time the template user creates a new iteration by clicking the Add Another button on a series dialog or starting a new line in a spreadsheet dialog.
This behavior is different to previous versions of HotDocs where a first iteration was created as soon as the interview launched.