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

First instance: {family[0].name}
Last instance: {family[-1].age}
Specific index: {family[2].relationship}
Current instance: {.name}

All Instances and Count

List all names: {family[*].name} → Output: John, Mary, Sarah
Custom separator: {family[*].name|join:"; "} → Output: John; Mary; Sarah
Count instances: {family.count} → Returns: 3

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."