Lesson 6: Replace Multiple Choice Text
Overview
Sometimes in your templates, you need to present a list of already-known options from which the user can choose. For example, you may need to prompt the user for the county where a filing must be made. Or, maybe you need to identify whether the party in a court case is the petitioner or the respondent. When you know ahead of time what the options are, you can present these lists of options using a Multiple Choice variable.
There are two important “parts” to a Multiple Choice variable—the options and the merge text. The options are what are presented to the user (and represent the answer that can be saved in the answer file), while the merge text is the actual text that is merged in the document. While these can often be one and the same, being able to distinguish between the two allows you to present a set of possible answers to the user, but merge something slightly different in the completed document.
In this lesson, you will create a Multiple Choice variable that asks the employee’s gender, but then merges different pronouns, based on this gender, throughout the template. You will also create a variable that merges the name of the company representative who signs the agreement.
Start the Tutorial
If you are continuing immediately from Lesson 5, skip the instructions for opening the template and proceed to Replace Pronouns with a Multiple Choice Variable.
If you closed the template at the end of Lesson 5, complete the following steps.
To open the tutorial template
- Open your word processor and click the HotDocs button, located on
your word processor’s toolbar. The My
Test Templates library appears.
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.
- Select Employment Agreement and click Edit. The template appears, ready for you to edit.
Replace Pronouns with a Multiple Choice Variable
The employment agreement template contains several pronoun references. To replace these references, you can create a single Multiple Choice variable that asks the employee’s gender. You can then insert the variable each place in the template a pronoun is used. You will assign specific merge text for each instance.
To replace the first pronoun
- In the Description of Employee’s Duties section, select the text him, located near the end of the paragraph.
- Click the Variable Field button. TheVariable Field dialog box appears.
- Select Multiple Choice in the Variable type group and then enter Employee Gender in the Variable box.
- Click the Edit Component button. The Multiple Choice Variable Editor appears.
- Type Male in the first row of theOption column and Female in the second row.
These are the options that will be presented to the user in the interview, but specific pronouns should be merged into the assembled document. To do this, you must enter merge text.
Assign Merge Text to a Multiple Choice Variable
When you assign merge text to a Multiple Choice variable, you can assign it in one of two places: at the Multiple Choice Variable Editor (the dialog box you are now viewing), or at the Variable Field dialog box. When assigned at the Multiple Choice Variable Editor, the merge text is used every place the variable is used in the document. When assigned at the Variable Field dialog box, the merge text is used for that specific instance of the variable only.
Since you will use Employee Gender to merge different pronouns later in the template, you will assign the merge text at the Variable Field dialog box.
To assign default merge text
You can also create merge text of your own by typing the text in the Merge Text column.
Choosing Replace Multiple allows you to search the entire template for instances and replace those instances.
- At the Multiple Choice Variable Editor, click OKto return to the Variable Field dialog box.
- Clear Use default. The Merge Text column becomes active, allowing you to assign specific merge text for the field.
Normally when entering merge text, you would type each merge text option in the appropriate rows of the Merge Text column. However, HotDocs includes a list of common pronoun sets from which you can choose predefined options. When selected, these options are automatically merged in the column.
- Click the Merge Text column heading. A list of pronoun sets appears. HotDocs provides these lists of pronoun sets by default.
- Select him/her.
The pronoun him appears in the first row of the Merge Text column and her appears in the second row.
- Click Replace Multiple. The Find and Replace dialog box appears.
- Select Find whole words only. (Selecting this option prevents instances of him that are part of other words from being replaced with the variable.)
- Click Replace All. The pronoun is replaced with the variable.
Choose Different Multiple Choice Merge Text
The first paragraph of the Duration of Employment section contains a different pronoun (“determined whether he will continue”) for the same person (the employee). Instead of creating a new variable to replace this pronoun, you can use the Multiple Choice variable you just created, but assign different merge text.
To replace another pronoun and change the merge text
- In the Duration of Employment section, select he and click the Variable Field button. The Variable Field dialog box appears.
- Select Multiple Choice.
- Click the Variable drop-down button and select Employee Gender from the list.
- Clear Use default.
- Click the Merge Text column heading and select he/she from the list.
- Click Replace Multiple.
- Select Find whole words only and click Replace All. The variable is inserted into the template.
On Your Own
The last pronoun you need to replace in the template is the pronoun his.
In the Duration of Employment section, select his, located near the end of the paragraph (“and upon his performance”), and replace it with the Employee Gender variable. Select his/her as the merge text. Replace all instances throughout the template, making sure you find whole words only.
Refer to the previous two sections if you do not remember how to do this.
Create Another Multiple Choice Variable and Add Resource Text to It
Another item of text that needs to be replaced in the template is the name of the company representative who signs the agreement. There are only three Hobble Creek Publishing employees who sign employment agreements: Stephanie Hanson, Ed Walters, and Kim Schuster. You can present these options using a Multiple Choice variable.
When creating variables, you can present additional information along with the variable to help the user know how best to answer the question. These helps are called resources.
When completing the agreement, users might not know which name to select for each agreement. You will add resource text to help them select the correct name.
To create a Multiple Choice variable and assign it a resource
If the rows in the Default Merge Text column are empty, the text from the Option column will be merged into the assembled document. Since you want the name you select to be merged into the document, do not enter any Default Merge Text for the options.
To assign resources to each individual option (or company representative), select each option at the Resource for drop-down list and then enter the text.
If the resource pane isn’t showing, click the Resource Pane button in the assembly window toolbar.
- Scroll to the end of the template.
- In the signature block, select Stephanie Hanson and click the Variable Field button. The Variable Field dialog box appears.
- SelectMultiple Choice and type Company Representative in the Variable box.
- Click the Edit Component button. The Multiple Choice Variable Editor appears.
- On separate rows in the Option column, type Stephanie Hanson,Ed Walters, and Kim Schuster.
- Click the Resource tab. The window changes to show resource options.
- Make sure Entire Multiple Choice Variable is selected at the Resource for drop-down list.
- Make sure Plain Text is selected at the Resource type drop-down list.
- In the Text box, type Stephanie Hanson signs for editorial employees, Ed Walters for marketing, and Kim Schuster for production.
- Click Test. A test assembly window appears and the information you just typed appears in the resource pane.
- Close the test assembly window and click OK at the Multiple Choice Variable Editor.
- Click Replace Once at the Variable Field dialog box. The variable is inserted into the template.
Conclusion
You are now finished with this lesson. In it, you learned how to use a Multiple Choice variable to merge correct pronouns—based on the employee’s gender—in the document. You also learned how to assign resource text to a variable to help a user know how to answer a particular question.
f you do not want to go on to Lesson 7 at this time, click the HotDocs Save and Close button to close the template. Then exit HotDocs.
If you are continuing on to Lesson 7, click the Save button to save your work.