Repeating Item Basics

With Repeating Items (aka Looping Lists), you can ask the same question multiple times to collect data about an undefined number of people/items/things.  For example, this is helpful in collecting information about a client's children.

Repeating Items/Questions must be on a separate page from other questions.  Please create a new page in your interview to add one.

Basic Formatting

Here's how to format your Word documents to output the data from a repeating question:

{% for item in ItemName %}

{{ item.ItemAttributeName }}

{% endfor %}

Here:

  • ItemName is the name you gave the item in the repeating question.
  • ItemAttributeName is the variable name for that item's attribute.
  • Everything is the same except the highlighted words.
Example:

Here’s an example for collecting information about the client’s children:

{% for item in children %}

Name: {{ item.FirstName }}

Birthdate: {{ item.dob }}

{% endfor %}

Here, children is the item name. FirstName and dob are the attributes you asked for.

Repeating Items in Tables

Want item/list information to populate into a table?  Format it like this in your Word document:

Formatting Looping Repeating Items Docassemble Documate Automation

The phrase item is static, and should be followed by a period, then the variable name for the attribute.