Automate Your Templates

The next step in the process is to actually start automating your templateA word processor or form document that has been converted to HotDocs format so that it can be automated. When in template format, changeable text in the template can be replaced with variables. Other instructions can be added as well, such as instructions that create lists, condition text, and insert other templates.s.

You can find detailed instructions on each phase of this process in the HotDocs Help.

Create the Template

You first begin by creating templates from the documents you marked up.

When you create a new template, you can enter a title and a description for the template. Include as much information as necessary to better identify the file. For example, if the file that’s created and saved to disk uses some cryptic file naming scheme (such as RLWHCP.docx), you could enter a different title that makes more sense, such as Revocation of Living Will and Health Care Proxy. In the description you can enter as little or as much information about the template as you feel necessary.

Also, if you plan to point your templates to a shared component file, you should do so right after you create the template and before you begin any automation work. That way HotDocs will correctly save any variables and other components you create to the shared component file.

We recommend that template names are kept to less than 52 characters and don't use non-ASCII characters. This will reduce the possibility of the template name causing errors if you later enable it for use with HotDocs Server.

Replace Template Text with Variables

Once the template has been created, you replace changeable text in the template with variable fields. If you’ve previously marked up the template, you should be using variable names and properties you defined in the markup.

As you create variables, you should test them (by clicking the Test button on the component editor). This shows you how the question will appear to the user. Frequently, testing helps you identify ways to improve the variable question. For example, if you’re testing a Text variable that requires the user to enter a long description, you may realize you forgot to adjust the answer field height to allow for multiple lines of answer text.

Make Text Conditional

Once you have replaced all of the variable information with variable fields, you should then review the document to identify sections of text that are optional. To mark these sections, you use IF instructions. IF instructions use a True/False variable (for example, Is the Client Married?) to determine whether to include text or not. More complicated instructions usually require more than a simple yes/no question to determine. An example of an expression would be IF YEARS FROM( Child’s Birth Date, TODAY ) <= 17.

There are two different ways you can use conditional text:

First, you can use IF and END IF instructions to include or exclude simple optional text. For example, in an employment agreement, you may need to include or exclude a paragraph describing a probationary period for the new employee. If the employee isn’t required to complete a probationary period, you wouldn’t include information about it.

Second, you can use IF, ELSE IF, ELSE, and END IF instructions to include alternative text. For example, you may have different versions of a paragraph, only one of which the user will include in the assembled document. Using ELSE IF and ELSE, you can create a series of conditions under which the user determines which text HotDocs will include.

Repeat Variables to Create Lists

Sometimes there are variables in a template that you need to repeat so users can enter more than one answer. For example, you may need to list the client’s children. Because you don’t know how many children a client may have, you can repeat the Child Name variable. This allows the user to enter as many children as necessary. You accomplish this by using a REPEAT instruction. You can repeat a single variable, or you can repeat entire sections of text.

Often, you must repeat information within a word processor table. For instructions on how to repeat a single cell or an entire row, see Use a Word Processor Table to Display a List.

Group Variables in Dialogs

As you know, variables in the template represent the questions users must answer during the interview. You can organize these variables into logical groupings, called dialogs.

Typically, when you create a dialog, you group similar questions together. For example, if the template asks for the name and address of a client, you could group all of these variables together in a single dialog named Client Information. Information about the spouse could be asked in a separate dialog, as could information about the case.

If HotDocs should ask questions only under certain conditions, you can use dialog scripting to include or exclude those questions. You can also select several different options that control the way the questions appear in the dialog. For example, you can choose to place all of the questions above the answer fields, or you can choose to place each question to the left of its answer field.

Test Assemble the Template

Test assembling a template is an imperative task in the template development process. Testing allows you to see the full interview as the user will see it. It provides an opportunity for you to correct mistakes, as well as fine-tune the interview process by improving questions and adding other information to make the process easier for the user.

It’s important that as you are testing, you enter many different combinations of answers. This exercises the scripting in your template and helps you ensure that no matter what answers users enter, HotDocs will assemble the document correctly.

As you test assemble a template, you should check for the following things:

  • HotDocs isn’t reporting any errors or warnings that you need to fix.
  • The interview outline looks right and operates properly.
  • Dialogs look right and operate properly.
  • HotDocs has assembled the document correctly with no unanswered questions and has correctly formatted the answers.

If you find problems as you are testing, you can leave the test assembly window open and make changes to the underlying components. You can then update the test assembly window with your changes.