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

Reference a Repeating Item Question

Refer to the responses to a prior repeating item question in a subsequent question using the two steps below:

Step 1. Add "repeating item reference" question to workflow
  1. Add a repeating item question.
  2. Add a multiple choice question or a repeating item with a multiple choice attribute. (Multiple choice could be single-select, multi-select, or dropdown)
  3. Select Reference a repeating item under the options.
  4. Select the repeating item you're referencing and up to two attributes, like this:
alt text here

Step 2. Add variables into document

Because each repeating item may have multiple attributes (e.g., children could have the attributes first name, last name, date of birth, residence, etc.), you need to reference the appropriate attribute, which will vary depending on the question type.

Option 1: Multi/single-select or dropdown question referencing a repeat

    {{ VariableName.ItemAttribute }}

Example from image above:

    {{ favorite_child.child_first_name }} {{ favorite_child.child_last_name }}

Option 2: Multi-select question referencing a Repeat

    {% for item in MultiSelectVariableName %}{{ item.ItemAttribute }}{% endfor %}

Example:

    {% for item in favorite_child %}{{ item.child_first_name }} {{ item.child_last_name }}{% endfor%}

Want to make this a comma list? Use the regular commalist formatting:

    {{ commalist(VariableName, '<ItemAttribute>') }}

Want to count how many items were selected in the multi-select? 

    {% if (MultiSelectVariableName.true_values())|length > 1 %}TEXT HERE.{% endif %}

Option 3: Repeating Item question referencing a Repeat

    {% for item in SecondItem %} {{ item.ItemAttribute.FirstItemAttribute }} {% endfor %}

Example: If the second item is "grandchildren," and we're asking who each grandchild belongs to (like in the image below), you would use:

    {% for item in grandchildren %}

    {{ item.grandchildname }} is the child of {{ item.grandchildparent.child_first_name }}

    {% endfor %}

alt text here

Example where attribute is a multi-select: If the repeating item referencing the first repeating item is a multi-select, the syntax will be slightly different, since a multi-select is a list of items, too.

Use this syntax for a comma-list:

    {% for item in Item2Name %}{{ commalist(item.Item2Attribute,"<Item1Attribute>") }}{% endfor %}

    {% for item in grandchildren %}{{ commalist(item.grandchildparent,"<child_first_name>") }}{% endfor %}

Use this syntax for a multi-line list:

    {% for item in Item2Name %}{% for selection in item.Item2Attribute %}{{ selection.Item1Attribute }}
{% endfor %}{% endfor %}

    {% for item in grandchildren %}{% for selection in item.grandchildparent %}{{ selection.child_first_name }}
{% endfor %}{% endfor %}