Lesson 4: Replace Text and Dates with Variables

Overview

Once you have created a template, the next step in the automation process is to replace text that changes, depending on the user, with variables. Variable fields represent where the user’s information (or answers) will be inserted in the docu­ment. Examples of text you’d replace with variables include names, dates, descrip­tions, numbers, and calculations.

This lesson teaches you how to create and insert Text and Date variables. It also teaches you how to create prompts for variables. Prompts are the questions the user sees when assembling the document.

Start the Tutorial

If you are continuing immediately from Lesson 3, skip the instructions for opening the template and proceed to “Replace the Employee’s Name with a Text Variable.”

If you closed the template at the end of Lesson 3, complete the following steps.

To open the tutorial template

If the My Test Templates library does not appear, choose Open Library (File menu), select the library in the default Libraries folder (for example, My Test Templates.hdl), and click Open.

  1. Open your word processor and click the hotdocs00145.jpgHotDocs button, located on your word processor’s toolbar. The Test Templates library appears.
  2. Select Employment Agreement and click edittemplate.jpgEdit. The template appears, ready for you to edit.

Replace the Employee’s Name with a Text Variable

The first instance of text that needs to be replaced in the template is the name of the employee, Tyson Jones, in the first paragraph. You will replace it with a Text variable.

To insert a Text variable

select-tyson-jones.jpg

If you are using Word 2007, 2010, and 2013, remember to click the HotDocs tab of the Word ribbon in order to see the HotDocs toolbar.

inset_2500155.png
inset_2600158.png

inset_2700161.png

inset_2800162.png

  1. Select (highlight) the text Tyson Jones, located in the first paragraph.
  2. Click the variable00152.jpgVariable Field button on the HotDocs toolbar. The Variable Field dialog box appears.
  3. In the Variable type group, make sure Text is selected.
  4. In the Variable box, type Employee Name.
  5. Because there are multiple instances of Tyson Jones in the template, click Replace Multiple. A variable component named Employee Name is created and the Find and Replace dialog box appears.
  6. Make sure the check box labeled Find whole words only is cleared. (Clearing this option allows HotDocs to replace all instances of Tyson Jones with the variable Employee Name, even if a specific instance ends with ’s.)
  7. Click Replace All. HotDocs replaces all instances of Tyson Jones with «Employee Name».

    replaced-tyson-jones.jpg

Replace the Job Title with a Text Variable

The next variable you will replace is the job title (Marketing Manager), which is in the Agreement to Employ and Be Employed section.

To replace the text with a Text variable

inset_2900168.png
  1. Select the text Marketing Manager.
  2. Click the variable00165.jpgVariable Field button. The Variable Field dialog box appears.
  3. Make sureText is selected in the Variable type group, and type Job Title in the Variable box.
  4. Since there is only one instance of this variable in the template, click Replace Once. The text is replaced with the variable.

Create Prompts and Adjust the Height of the Answer Field

The next item of text that needs to be replaced is the list of job duties in the Descrip­tion of Employee’s Duties section.

To replace the list of job duties with a HotDocs variable

An easy way to select or highlight text using the keyboard is to press and hold the Shift key as you press the right or left arrow keys. To select full words at a time, press and hold both Shift and Ctrl as you press the arrow keys.

inset_3000174.png

Before you insert the variable into the template, you can test the variable to see how it will look to the user during the interview.

  1. Select (highlight) the text overseeing all marketing initiatives for the company and managing a team of writers and designers. (Do not select the period.)
  2. Click the variable00171.jpgVariable Field button. The Variable Field dialog box appears.
  3. Select Text and type Job Description in the Variable box. (Do not click Replace yet.)

To test the variable

inset_3100180.png

You can have HotDocs arrange the template and the test assembly window so that you can view both simultaneously. To do this, resize the test assembly window to the height you want and click the arrange.jpgArrange button in the test assembly window toolbar.

inset_3200185.png

Note that the variable name is used to ask the question the user must answer. In this case, the name does not make a good prompt because it doesn’t help the user’s answer fit into the rest of the sentence. Also, the answer field shows only a single line, which could be a problem for an employee who must list many different job responsibilities.

inset_3300191.png

Clicking Update allows HotDocs to re-display the test assembly window with your changes. However, your changes aren’t saved to the component file until you click OK or Save at the Variable Editor.

  1. With the Variable Field dialog box still open, click the edit00177.jpgEdit Component button, next to the variable name. The Text Variable Editor appears.
  2. Click Test. A test assembly window appears, with the question and answer field showing in the dialog pane.
  3. With the test assembly window still displayed, place your cursor in the answer field and click the edit00188.jpgEdit Component button in the assembly window toolbar. The Text Variable Editor comes to the front.
  4. In the Prompt box, type the following text:

    Complete the following sentence: Job duties shall include

  5. At the Field height box, click the up arrow until the number 4 appears. This will make the answer field four lines high.
  6. Click Update to view the test assembly window again.
    inset_3500194.png

    The new prompt appears and the answer field is large enough to hold a longer answer.

  7. Choose Close (File menu) to close the test assembly window.
  8. Click OK at the Text Variable Editor, and click Replace Once at the Variable Field dialog box.

Replace Dates with Date Variables

The Employment Agreement template includes several dates that need to be replaced with Date variables. The first date is the agreement date, located in the first para­graph.

To replace the agreement date with a Date variable

inset_3600200.png

The format you assign here will be used for this instance of the variable only. In other words, if you insert this same variable later in the template, it will not have this format assigned. If you want to assign a format that will be used every place the variable is merged, click the edit00203.jpgEdit Component button at the Variable Field dialog box and select an example format from the Default format drop-down list.

Notice that when you select Date, the Format box in the Merge field properties group shows an example format. This controls the format of an answer when it is merged into a document. It is suggested based on the format of the template text you selected.

In addition to the variable name, the format, third day of June, 1990, is merged into the field as well.

  1. Select the text sixth day of January, 2009 and click the variable00197.jpgVariable Field button. The Variable Field dialog box appears.
  2. In the Variable type group, select Date.
  3. In the Variable box, type Agreement Date and click Replace Once, since the agreement date appears only once in the document.

On Your Own

The next variable you will replace is the date the employee will start work (February 1, 2009), located at the end of the Agreement to Employ and Be Employed section. Replace the text now with a Date variable named Start Date.

See the previous section for a description of how to do this if you need help.

Use an Unanswered Variable Placeholder

The template includes a date the document will be signed by Hobble Creek Publishing representatives and the employee. Sometimes, however, this information may not be known when the document is assembled.

By default, when users leave questions unanswered, HotDocs displays a warning and then merges a placeholder in the assembled document that indicates the answer is missing. To keep this from happening, you can specify a variable property that instead inserts a blank line so that the date can be entered by hand later. You can also suppress the warning that the variable is unanswered.

You will replace the signature date near the end of the template.

To use an answered variable placeholder

inset_3700212.png

inset_3800213.png

inset_3900214.png

inset_4000215.png

replace-signature-date.jpg

  1. Scroll to the end of the template.
  2. Select January 6, 2009 and click the variable00206.jpgVariable Field button. The Variable Field dialog box appears.
  3. Select Date and type Signature Date in the Variable box.
  4. Click the edit00209.jpgEdit Component button next to the Variable box. The Date Variable Editor appears.
  5. In the Prompt box, type Signature Date (Leave blank if unknown).
  6. Click the Advanced tab. The view changes to show advanced properties of the variable.
  7. Clear Warn when unanswered. This keeps HotDocs from displaying an unan­swered warning if the user leaves the answer blank. (This warning would other­wise appear at the end of the interview.)
  8. Click OK at the Date Variable Editor. You are returned to the Variable Field dialog box.
  9. Click Show Advanced. The dialog box expands to show advanced options.
  10. In the Unanswered text box, enter several underline characters, like this: __________.
  11. Click Hide Advanced to hide the properties again.
  12. Click Replace Once. The text is replaced with a variable field.

Conclusion

You are now finished with this lesson. In it, you learned how to create Text and Date variables. You also learned how to add a prompt to a variable and change how it looks in the interview. Finally, you learned how to insert a blank line in the document if the user doesn’t answer the question during the interview.

If you do not want to go on to Lesson 5 at this time, click the HotDocs close00218.jpgSave and Close button to close the template. Then exit HotDocs.

If you are continuing on to Lesson 5, click the save00221.jpgSave button to save your work.