Repeating Item questions must be placed on their own dedicated page. Do not add other question types to the same page as a Repeating Item. Create a new page in the Builder before adding one.
How repeating items work
When you add a Repeating Item question, you define:- The item name — a variable name representing the collection (e.g.,
children,assets,parties) - The attributes — sub-questions for each entry (e.g.,
FirstName,dob,address)
Basic document syntax
Use this pattern in your Word document template to output data from a Repeating Item:ItemName— the variable name you gave the repeating itemItemAttributeName— the variable name of a specific attribute (sub-question)
Bulleted or numbered lists
To output repeating item data as a bulleted list, apply Word’s list style to the attribute line inside the loop:Tables
To populate a table in your Word document with repeating item data, add the for/endfor tags to the first and last rows of the table respectively, with attribute variables in the middle rows. Gavel will generate a new table row for each entry in the list.Nested repeating items
You can add a Repeating Item inside another Repeating Item to collect data about sub-lists that belong to each entry in the parent list. For example: a list of children (parent repeating item), where each child may have their own list of grandchildren (nested repeating item).Setting up nested repeating items
- Add a Repeating Item question for the parent list (e.g.,
children). It must be on its own page. - Add at least one attribute question to the parent Repeating Item.
- Click Add another within the Repeating Item editor and choose Repeating Item as the question type.
- Give the nested item a name (e.g.,
grandchildren) and add its attribute questions.
Page titles for nested items
Because nested Repeating Items always display on their own page during the questionnaire, you can customize the page title to show context from the parent entry. Use the syntax:Nested repeating items in Word documents
Nested repeating items in PDFs
To reference a specific entry from a nested repeating item in a PDF field, use:#— zero-based index of the parent entry (0 = first, 1 = second, etc.)##— zero-based index of the nested entry
Conditionals with repeating items
You can write conditional text in your documents based on the number of repeating item entries or on the value of a specific attribute.Conditional text based on count
Conditional text within a loop
Filter the loop to only matching items
To output only entries where a specific attribute matches a value:Test whether multiple entries share an attribute
Counting and referencing specific entries
Display the total count
Reference a specific entry by position
[0], the second is [1], and so on.
Example — first and third child’s name:
Reference the entry’s position within the loop
Calculate the sum of a numeric attribute
Advanced position-based text
Add text only when an item is not the last in the list:Tips for working with repeating items
Always use a separate page
Repeating Item questions cannot share a page with other question types. Create a dedicated page before adding the question.
Keep item names simple
Use short, lowercase variable names for repeating items (e.g.,
children, assets, parties). These appear repeatedly in your document syntax.Use the initial question option
When there might be zero entries (e.g., “Does this client have children?”), enable the initial question to avoid empty loops in your document.
Test with multiple entries
Always test your repeating item workflow by adding two or three entries. A single entry can mask looping issues that appear with multiple entries.
