Using Repeat Answers in the SmartObject

Repeat Answers are items of answer data entered in the repeat fields of a HotDocs Template. If you want to use a template that includes a REPEAT instruction in your SmartObject you must follow the additional steps below before you execute the SmartObject.

You can only use one repeat level in the SmartObject. In other HotDocs programs, a repeat answer can usually be nested, meaning you can create sub-lists within your initial repeat list (for example, in a list of children you can also include sub-lists of grandchildren). This is not possible in the SmartObject.

In this Topic Hide

Prerequisites

Identifying Repeat Answers in a SmartObject

Repeat Answer Data

Example Repeat Answer Data

Using Repeat Answers in the SmartObject

SmartObject Tester

Prerequisites

For repeat answers to work in the Smart Object, you must first:

  1. Create a HotDocs template containing a REPEAT instruction
  2. Upload the Template to the HotDocs Template Hub
  3. Register the HotDocs Service Type
  4. Register a new Service Instance using the template.

Identifying Repeat Answers in a SmartObject

Repeat answer fields in the SmartObject are always prefixed with RPT-. A Repeat field always takes the name of the corresponding Repeat Dialog in your template. For example, if your template contains a Repeat Dialog named EmployeesInformationDialog, the repeat answer field in the Smart Object will be named RPT-EmployeesInformationDialog.

Repeat Answer Data

Repeat Answer Data is a JSON string containing values for the data.

Example Repeat Answer Data

HDDATA-[{"EmployeesInformationDialog":[{"Name":"Role description","Value":"Engineer","Type":"Text"}]},{"RepeatHotDocsInputs":[{"Name":"Role description","Value":"Secretary","Type":"Text"}]}]

Using Repeat Answers in the SmartObject

SmartObject Tester

Create a SmartObject for the REPEAT dialog

  1. Open the SmartObjects Services Tester (typically located in C:\Program Files (x86)\K2 blackpearl\Bin).
  2. In the ServiceObject Explorer folder, expand the required Service (e.g. HotDocsServiceBroker).
  3. Expand the required Service Instance (e.g. Employment Agreement).
  4. Expand the Repeat Variables node.
  5. Expand the template node folder (e.g. EmployeeContract) where you want to create repeat data.
  6. Right-click on the dialog node (e.g. EmployeeInformation) you want to use and select Create SmartObject.
  7. Click Publish SmartObject. Close the Publish SmartObject window.

Execute a SmartObject for the REPEAT dialog

  1. Open the SmartObjects Services Tester (typically located at C:\Program Files (x86)\K2 blackpearl\Bin).
  2. Navigate to the SmartObject Explorer node and expand All SmartObjects.
  3. Right-click on the SmartObject created in the step above and select Execute SmartObject.
  4. In the Method to Execute drop-down menu, select AddItem.
  5. In the Input Properties section, enter appropriate data to the repeat variables (excluding the Serialised List field).
  6. Click Execute. The repeat answer data appears in the Serialised List field.
  7. To add more repeat data, enter new data into the fields in the Input Properties section.
  8. Click Execute. The new repeat answer data also appears in the Serialised List field. It will look something like:
    HDDATA-[{"RepeatHotDocsInputs":[{"Name":"Role description","Value":"Engineer","Type":"Text"}]},{"RepeatHotDocsInputs":[{"Name":"Role description","Value":"Secretary","Type":"Text"}]}]
  9. Once all the data is added to the Serialised List field, select and copy the data. Close the Execute SmartObject window.

Execute a SmartObject for the template package containing the REPEAT SmartObject

  1. Open the SmartObjects Services Tester (Normally located at C:\Program Files (x86)\K2 blackpearl\Bin).
  2. Navigate to the SmartObject Explorer folder.
  3. Navigate to the SmartObject for the template you selected above (e.g. EmployeeContract), which you created the repeat data for.
  4. Right-click the SmartObject and select Execute SmartObject.
  5. In the Method to Execute drop-down menu, select an option:
  6. Enter the input properties:
  7. In the Input Properties section, identify the field with the same name as the Dialog node selected above, prefixed by RPT- (e.g. RPT-EmployeeInformation).
  8. Paste the repeat answer data into that field.
  9. Click Execute.