Nested repeats
A nested repeat refers to a scenario where there are repeat spans within repeat spans. For example, if there is a repeat for companies and within each company there is another repeat for directors, this would be considered a nested repeat. It allows a hierarchical presentation of related information.
<
Repeat CompanyCount
{CompanyName} with directors <
Repeat DirectorCount
{DirectorName}>>
Customising Repeat Titles for Nested Repeats
Customising the Repeat Titles for nested repeats can help display the relationship between the questions more clearly and can make navigating the groups easier.
Repeated groups that are nested will automatically display a breadcrumb link in the Repeat Titles to help the user understand the variables’ relationship with the parent group and easily navigate to it. The breadcrumb will follow the pattern “of [Parent Repeat title]”. They will appear differently depending on whether the groups are collated or not.
You can use {repeatcounter} to customize the Repeat Titles to clearly display which parent group the variables are related to. For example, for a repeat of 3 nested levels such as:
<
Repeat CompanyCount
{CompanyName}, <
Repeat EmployeeCount
{EmployeeName}, <
Repeat PhoneNumberCount
{PhoneNumber}>>>
By customising the Repeat Titles of the groups nested across 3 levels as follows:
Companies: “Company {repeatcounter}”
Employees: “Employee {repeatcounter}”
Phone number:“Phone number {repeatcounter}”
The questionnaire group titles will display in the questionnaire as “Company 1”, “Employee 1 of Company 1” and “Phone number 1 of Employee 1” for the first repetition of the respective repeated groups.
You might also want to display variable data in the Repeat Title to make it easier for your users to follow. For example, by customising the Repeat Titles of groups nested across 3 levels as follows:
Companies: “{ifknownelse(Company, concatenate("Company #"+repeatcounter))}”
Employees: “{ifknownelse(Employee, concatenate("Employee #"+repeatcounter))}”
Phone number: “Phone number {repeatcounter}”
This will display in the questionnaire as “Thomson Reuters”, “Employee #1 of Thomson Reuters” and “Phone number #1 of Employee #1” for the first repetition of the respective repeated groups:
Layout options for Nested repeats
Nested repeats can be displayed in two primary layouts, collated and non-collated. This setting is applied at the page level containing the nested repeated groups.
When nested repeats are collated, they are grouped together with their corresponding parent repeat instance. The indentation between the groups indicates the nesting level to make the hierarchy between the groups clear.
For example, for a nested repeat such as
<
Repeat CompanyCount
{CompanyName}, <
Repeat EmployeeCount
{EmployeeName}, <
Repeat PhoneNumberCount
{PhoneNumber}>>>,
the order of information that will be presented in the questionnaire is as follows:
In the example below, the nested groups are in a page that is collated and the Repeat titles for the groups Companies, Employees and Phone Numbers are left blank:
Note that grid layout option is not compatible with the collated of nested repeats.
The non-collated presentation of repeat groups maintains the original groups together in their respective nesting level.
For example, for a nested repeat such as
<
Repeat CompanyCount
{CompanyName}, <
Repeat EmployeeCount
{EmployeeName}, <
Repeat PhoneNumberCount
{PhoneNumber}>>>,
the order of information that will be presented in the questionnaire is as follows:
Phone numbers of Employee #1 of Company #1:
Phone number #1
Phone number #2
Phone numbers of Employee #2 of Company #1:
Phone numbers of Employee #1 of Company #1: