FORMAT Instruction

The FORMAT instruction enables you to type a list format to punctuate a list of answers you gather using a repeated dialog.

The REPEAT instruction is only available when you are creating a computation but you can access the same functionality from the Field Editor when you're adding a repeated region in a template.

You can use a FORMAT instruction in a computation to provide the same functionality as the Format property in the field editor when you're modifying a repeated region in a template. However rather than selecting a format from a drop-down list, in a computation you need to write out one of the list formats in your component file.

You can only use a FORMAT instruction between a REPEAT instruction and an END REPEAT instruction.

Instruction name Model After you drag and drop the model into the script tab:
FORMAT FORMAT "List_format" Replace "List_format" with the list format you want HotDocs to use when it adds this list to the template.

Example

For example, perhaps you want the items in your list to appear with a (Oxford) comma preceding the and at the end of your list. Your script would look like this:

"" REPEAT Education Information

FORMAT "A, B, and C"

RESULT + Degree Designation

END REPEAT

RESULT

Once a user has provided the list of educational degrees in Education Information, the FORMAT instruction ensures that the requisite commas are in place.

Download

After you download the example template, you can import the template to any workspace to see this example code in action.