Introduction: Create and Customize Variables

Once your document text is in a template file, you must replace variable text (text that changes each time you assemble a document) with HotDocs variables. Examples of variable text include names, dates, pronouns, numbers, and calculations. A variable is what prompts HotDocs to ask for that information when the template is used to assemble a document.

You can create seven types of variables: Text, Date, Number, True/False, Multiple Choice, Computation, and Personal Information. The variable type determines what information users can enter when they complete an interview. For example, if you create a Date variable, users must enter a valid date—they cannot enter text, such as a name, for an answer.

The following graphic shows a paragraph that contains two items that change depending

on the user—the name (Aaron Jameson) and the date (12th day of October, 2002):

You replace both of these items with variables:

There are two parts to creating variables—creating the variable component, and creating the variable field:

  • Variable Component: The variable component is the core part of a HotDocs variable. It contains all the information about a variable and how it should be processed, including the component name and prompt, any resource information, and any special patterns or other options that help control how the variable appears during the interview and how it will be processed when the final document is assembled. A variable component also creates an association between the components and the answers the user enters, so that the answer can be saved in an answer file. (Answer files can be reused when assembling other documents.)
  • Variable Field: When you insert a variable into a HotDocs template, HotDocs creates a field where the user's answer is merged into the assembled document. In a text template, the field is denoted by HotDocs chevrons (« »), while in a form template, the field is denoted by a colored box that is overlaid on the form's static text. There are certain properties that are assigned to a variable's field that affect the way the variable is merged into the document—specifically, formats and merge text for Multiple Choice variables. You can also include fill characters that force the answer to be a certain number of characters, regardless of how long the answer is.

If you want to include a chevron in a HotDocs text template either as a part of your document text or a literal text string, you need to double the opening chevron (but not the closing chevron), so that HotDocs does not interpret the chevrons (and any text between them) as a field. The output is a single chevron, as follows: input: ««some text», output: «some text».

 

When you insert a variable into the template, you automatically create a merge field for the variable. However, when you create a variable using Component Manager, there is not a merge field associated with the variable until the variable is inserted into the template.