Repeat Groups
Collect multiple instances of the same question set with powerful referencing.
What are Repeat Groups?
Repeat groups allow you to collect the same questions multiple times. They are perfect for household members (name, age, relationship), purchase items (product, quantity, price), and timeline events (date, description, outcome). You can reference specific instances using index notation, list all instances with custom separators, and count the total number of instances.
Referencing Instances
All Instances and Count
Complete Example
For a repeat group named "family" with questions name, age, and relationship, you can display: "You have {family.count} family members: {family[*].name}. The oldest is {family[-1].name} at {family[-1].age} years old. Average age: {family[*].age.avg|number:1} years."
Sibling References (Dot-Prefix)
Inside a repeat group instance, use the dot-prefix syntax to reference other sub-questions within the same instance. This is useful for calculations and conditional logic that depend on values entered in the same row.
Dynamic Instance Titles
Use $i in the group label to pull a value from a table row matching the current instance index. This lets each repeat group instance show a meaningful title instead of just a number.
$i inside a table row reference — it is replaced with the 0-based instance indexArm {armMap[$i].Name}When the group label contains { or $i, the automatic instance number (1, 2, 3…) is suppressed since the label is already dynamic. Plain labels like "Arm" still show "Arm 1", "Arm 2", etc. as before.
Nested Repeat Groups
Repeat groups can contain other repeat groups for multi-level data collection. For example, a "households" repeat group can contain a "members" repeat group, allowing you to collect multiple members per household across multiple households.
Referencing Nested Repeat Group Items
Use the two-level bracket syntax to reference sub-questions inside a nested (inner) repeat group. All names refer to the "Name" field of each question, not the label.
Same-Survey References
Multi-Select Field Indexing
If the field is a multiple select question, append a bracket index to pick a specific selection from the answer array.
Aggregation
Append an aggregation function after the field name to compute across all matched values. Supported: .sum, .avg, .min, .max, .count.
Cross-Survey Nested References
Prefix with the survey reference to pull nested repeat group data from another survey.
$i / $n with Nested Groups
$i (0-based) and $n (1-based) always refer to the innermost repeat group instance. They reset for each outer instance.
Example: outer has 2 instances, inner has 3 and 2 instances respectively
$i and $n are automatically substituted in all reference contexts: text labels, notes, calculations, constraints, and display conditions.
Using Repeat Group Answers as Options
You can use answers collected in a repeat group as dynamic options in other questions. This is useful when you want a later question to reference all values entered across repeat group instances.