Source URL: https://docs.surveycto.com/02-designing-forms/04-sample-forms/08.rosters-hybrid.html
Last updated: 2024-03-27
Rosters: A third, hybrid method for repeated questions (repeat_count)
To open or use this sample form, go to the Design tab, scroll down to the Your forms and datasets section, and click + then Start new form; then enable Use a sample form as your starting point and choose Rosters: A third, hybrid method for repeated questions (repeat_count) from the list. You can also click here to download the spreadsheet form definition.
This sample demonstrates a method for handling rosters (repeated questions) that is a hybrid between the two methods demonstrated in the previous rosters sample. It asks the user how many family members there are, then uses a repeat group to ask questions about exactly that number of family members.
In the spreadsheet form definition, the crux of this method is the repeat_count column in the begin repeat row, which you may need to scroll to the right to see:
type | name | label | repeat_count |
integer | numfamily | How many family members live with you? | |
begin repeat | fam_group | Family member | ${numfamily} |
In this case, the repeat_count column is used to repeat the group once for each family member, according to the count given by the numfamily field.