Documate is now Gavel! Read more about why we’re excited about this rebrand.

Duplicate Docs for Each Repeating Item

You can generate a separate copy of the document customized to each item in a repeating item. For example, if you have a repeating item for "children" or "shareholders", you can have a separate document generate with the appropriate information for each child or shareholder.  

Watch this video on how, or read our two-step instructions below:

Step 1: Set up your document with the variable name.

Set up your Word document like you normally do, but in any space you want customized to the specific iteration of the Repeating Item question, use this:

{{ ItemName[i].ItemAttribute }}.

For example, if your repeating item is "children", with attribute "childname", use:

{{ children[i].childname }}.  

Keep the letter "i" in the document, which stands for the number of the item (for example, child #1, #2, #4, and so on). This will generate one document for each child that is entered, and each document will be customized with one child's name.

This syntax can also be inserted using the no-code Word add-in. Just select the "Generate Multiple Documents" format in the "Repeating Item" section of the add-in.

Step 2: Click "Generate Multiple" on the document's label and select the repeating item.
Mail merge document automation


In the example above, this interview will generate 1 Master Document and a Document for Each Child for each of the children listed in response to the Repeating Item question for "children."  If there are three children, three documents will be generated, and each document will have the name of one of the children.

Advanced Options

You can also set conditions so that different versions of a document have different text depending on the attributes of the repeating item, like this:

{% if ItemName[i].ItemAttribute == 'Value' %} Some text here. {% endif %}

For example:

{% if children[i].gender == 'Male' %} This child is a male. {% endif %}

You may want to include the entry number in your documents or document titles. You can accomplish this by adding the following:

Inside your documents:

{{ i+1 }}

In your document title:

${i+1}

You can also list values from a nested repeating item in each document like this:

{% for nesteditem in ItemName[i].NestedItemName %}

{{ nesteditem.NestedItemAttribute }}

{% endfor %}

For example:

{{ Children[i].ChildName }} has the following children:

{% for nesteditem in Children[i].Grandchildren %}

{{ nesteditem.GrandchildName }}

{% endfor %}