Lesson 15: Create Lists of Answers

Overview

Sometimes when completing an interview, you need to enter two or more answers for a given question. These answers generate a list within the document. For example, perhaps you need to include the names of several customers, rather than just a single customer. To accomplish this, you can repeat the Customer Name vari­able. This allows the user to enter as many answers as necessary and each name will be merged.

In this lesson, you will use a REPEAT instruction to create a list of colleges the employee has attended. You will repeat an entire paragraph of text as well as just a portion of an existing paragraph. In a later lesson, you will also learn how to repeat rows in a word processor table.

Start the Tutorial

If you are continuing immediately from Lesson 14, skip the instructions for opening the template and proceed to “ Repeat a Paragraph.”

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

To open the tutorial template

  1. Open your word processor and click the hotdocs00224.jpgHotDocs 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.

  2. Select Employment Agreement and click edittemplate00227.jpgEdit. The template appears, ready for you to edit.

Repeat a Paragraph

You can include lists of answers in your documents by repeating variables and allowing the user to enter as many answers as necessary. You repeat variables by surrounding the variables with a REPEAT instruction. Instead of collecting and merging a single answer, as variables normally do, the repeated variable can merge an entire list of answers into the assembled document.

In the Employee Personal Data template, employees must list each college they’ve attended, as well as degrees earned and the curriculum studied. Each college is listed in its own paragraph.

To insert the REPEAT instruction

  1. In the EDUCATION DATA section, highlight the indented paragraph under Colleges or Universities Attended. (Make sure you include the paragraph mark.)

    This is how it should look in Word:

    repeat-word-selected.jpg

    This is how it should look in WordPerfect:

    repeat-wordperfect-selected.jpg

  2. Click the repeat00801.jpgREPEAT Field button. The REPEAT Field dialog box appears.

    inset_14300804.png

You must create the dialog you will use in the REPEAT instruction. (The variables you will add to the dialog have already been created for you.)

To create the dialog

  1. In the Dialog box, type Educational Information and click the edit00805.jpgEdit Com­ponent button. The Dialog Editor appears.
    inset_14400808.png
  2. Drag the following variables, in this order, from the Components list to the Contents list:

    University or College Name

    Years Attended

    Curriculum Studied

    Degree Earned

Next you must specify the style for the repeated dialog. You can either present the list as a series of dialogs or as a single spreadsheet with multiple entry points.

To choose a presentation style for the list

  1. At the Style drop-down list, make sure Repeated Series is selected.
    inset_14500811.png
  2. Click OK at the Dialog Editor. (Do not close the REPEAT Field dialog box yet.)

Sort the List of Answers

When creating a list of colleges, not all users will enter the schools in the order they attended them. You can organize the list by sorting its answers.

To sort the list based on dates attended

  1. At the REPEAT Field dialog box, click Show Advanced. The dialog box expands to show advanced options.
    inset_14600814.png
  2. Click the Sort by drop-down button. HotDocs displays a list of variables used in the dialog.
    inset_14700817.png
  3. Select Years Attended.
  4. Click the Ascending drop-down button and choose Descending. This will list colleges in order, starting with the most recent.
    inset_14800820.png
  5. Click OK to close the REPEAT Field dialog box. The REPEAT instruction is merged in the template.

    repeat-word-inserted-1.jpg

  6. If you are using Word, position your cursor before the «REPEAT Educational Information» instruction and press the Backspace key so the REPEAT instruc­tion is aligned with the left margin. (Doing this ensures the list is properly tabbed in the assembled document.) If you are using WordPerfect, do nothing.

    repeat-word-inserted-2.jpg

Test a Portion of the Template

Just as you can test assemble the entire template, you can select just a portion of the template text and test it.

To test the REPEAT instruction

  1. At the template, select the text starting with the opening REPEAT instruction and ending after the closing REPEAT instruction, like this:

    select-repeat-instruction.jpg

  2. Click the testassemble00829.jpgTest Assemble button. The test assembly window appears.
  3. Answer the questions in the first dialog.
  4. Click the additeration.jpgAdd Another. A new, empty repetition of the dialog, Educational Information, appears again.

    Notice that as you provide answers at each dialog, HotDocs adds repeated dialog icons to the interview outline. If you later decide to add more informa­tion, you can click the last dialog and then click the additeration00834.jpgAdd Another button again.

  5. Enter answers for as many colleges as you want, clicking additeration00837.jpgAdd Another for each new college. When you are finished, click next00840.jpgNext.
  6. Click the Document Preview tab to see the generated list. Notice how the list is sorted in order, starting with the most recent school.
    inset_14900843.png
  7. Close the test assembly window. HotDocs returns you to the template.

Create a Sentence-Style List

You can also use REPEAT instructions to create lists within a sentence. When repeating a part of a sentence, you can specify the punctuation that will be used to separate the items in the list.

Next, you will insert a list of the degrees the employee has earned. You can use the dialog you created for the previous REPEAT instruction.

To create a sentence-style list

  1. Under the Degrees Earned heading, select the text after the colon, «Degree Earned» («University or College Name»). (Do not select the closing period.)

    select-degrees-earned.jpg

  2. Click the repeat00848.jpgREPEAT Field button. The REPEAT Field dialog box appears.
  3. Click the Dialog drop-down button and choose Educational Information.
  4. Click the Format drop-down button and choose a, b, and c from the list.

    inset_15000851.png

You will now create a filter to show only those schools where the employee has received a degree.

Create a Filter

In the previous paragraph in the template, you created a list of all colleges or univer­sities the employee attended, regardless of whether he or she earned a degree from the school. In this paragraph, you will filter the list to show only those colleges where the employee received a degree.

A filter must result in a true/false (or yes/no) value. In this instance, the filter will list only the colleges where the employee earned a degree.

To create the REPEAT instruction

  1. At the REPEAT Field dialog box, click Show Advanced.
    inset_15100852.png
  2. Click the edit00855.jpgEdit Component button next to the Filter by drop-down list. The Computation Editor appears.
    inset_15200858.png
  3. In the Variable Name box, enter the name Graduated.
  4. In the Script box of the Computation Editor, enter this script:

    Degree Earned != "No Degree"

    The operator != means “does not equal.”

    This expression looks at the answer for the Multiple Choice variable, Degree Earned. For each repetition, if the user selects any answer but No Degree, the school (along with the degree achieved) is merged in the document.

  5. Click OK at the Computation Editor. testassemble00861.jpg
  6. Click OK at the REPEAT Field dialog box. The REPEAT instruction is merged in the template.

If you’d like, you can test your work to see how the list is repeated, as well as filtered. To do this, highlight the portion of the template you want to test, click the testassemble00861.jpgTest Assemble button, and answer the questions in the interview. Review the document at the Document Preview tab. Close the test assembly window when you are finished.

Conclusion

You are now finished with this lesson. In it, you learned how to repeat the text of an entire paragraph to create a list of answers. You also learned how to repeat a portion of text within a paragraph. Finally, you learned how to punctuate, sort, and filter answers in a list to customize how the list appears.

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

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