Use an Answer File to Control the Interview

From HotDocs Wiki

Jump to: navigation, search

At times, you may want to use information you already know to cause the interview to operate differently based on who is completing it. One way to do this is to use a control answer file, which provides the answers necessary to control the interview "behind-the-scenes."

For example, you may have a purchase order you want to use for clients in several states. However, in some states, there is no sales tax. Rather than force the user to specify this, you can use a control answer file to set the conditions so that the correct questions appear (or hide) depending on which state the user lives in.

There are two parts to creating a template that uses a control answer file:

Part 1: To automate the template

1. Automate the template that contains the text that will change, depending on the user.
2. Place a condition instruction or expression around the section of the template that will change.
3. For the variable controlling the instruction or expression, clear the following advanced option: Ask automatically, Save in answer file, and Warn when unanswered.
4. Once template automation is complete, save and close the template.

Now that you automated the template, the next step is creating an interview template that contains the same variable you used in the conditional instruction or expression. You will assemble the interview template to generate the control answer file you will use with the text or form template (in this example, the purchase order).

Part 2: To create the control answer file

1. Create an interview template that asks the variable used in the expression.
2. Once your script is finished, save and close the interview template.
3. Assign the following command-line options to the interview template:

/af="control answer file path and name.anx" /sa /la

4. Assign the following command-line options to the text or form template you automated earlier:

/ov="control answer file path and name.anx"

To test your work, first assemble the interview template. HotDocs will ask the question that will control how the interview operates. Once you have entered an answer, HotDocs saves the answer file you specified (using the command-line options). Second, assemble the main template. Because you have used the overlay answer file command-line option, the answers you entered in the interview template are automatically used for this template and the condition in the template is processed without requiring any additional information from the user. Once you have generated all the control answer files you need for the various versions of the template, you can delete the interview template from the template library. When distributing the template to users, make sure you include the control answer file with the template.