How to Create a Form that Repeats a Group of Fields for Each Selected Option

About Bindings

In some cases, you may need to collect repeatable sets of data from respondents—for example, family members to include in an insurance policy, previous addresses, or test results. Survey Creator allows you to do this using the Dynamic Panel element.

A Dynamic Panel includes the main title (for example, List the countries you've visited in the past 10 years) and individual dynamic titles for each repeatable group of fields. Since you may not know how many entries a respondent needs to provide, a Dynamic Panel allows them to add entries as needed.

When configuring a Dynamic Panel, you can define fixed limits for the number of entries:

  • Initial number of entries – the number shown when the respondent reaches the question (default: 0)
  • Minimum number of entries – the required minimum (default: 0)
  • Maximum number of entries – the allowed maximum (default: 100)

However, in some cases, you may want the number of entries to be set dynamically—for example, based on selected choices in a multi-select question (such as a Multi-Select Dropdown or Checkboxes) or a numeric input from a Single-Line Input question. You can achieve this using the Bindings property. It connects the Dynamic Panel to another question and automatically adjusts the number of available entries based on the respondent's input.

This guide explains how to:

How to Repeat Form Fields for Each Selected Option

In this example, we use a Multi-Select Dropdown (Tag Box) question. The same configuration applies to a Checkbox question.

Configure the Multi-Select Question

  1. Add a Multi-Select Dropdown question to your form.
  2. Set a Question name (ID), Question title, and, optionally, a Question description.
Add and configure a Multi-Select Dropdown question
  1. In the Choice Options category, locate the Choices table and click the Pen icon to enter the choices in bulk.
  2. Enter your choice options in the popup using the choiceValue|choiceText format.
  3. Click Apply.
Add choice options to the Multi-Select Dropdown in bulk
  1. (Optional) Enable Allow custom choices if respondents should be able to create additional choice options that might be missing.
Allow respondents to add custom choice options
  1. Go to the Data category and locate Join identifier.
  2. Enter a value that will connect this question with the Dynamic Panel (for example, family).
Specify a join identifier for the Multi-Select Dropdown

Configure the Dynamic Panel

  1. Add a Dynamic Panel question to your form.
  2. Set a Panel name, Panel title, and, optionally, a Panel description.
Add and configure a Dynamic Panel question
  1. Add the questions you want to repeat inside the panel.
Add questions to the Dynamic Panel
  1. In the General category unselect the Enable entry addition and Enable entry removal properties. This ensures that respondents cannot manually remove or add new entries, and their number is controlled only by the bindings.
  2. To create a dynamic title for each entry, locate the Entry title pattern property.
  3. Enter a title pattern, for example: Relative #{panelIndex}. The {panelIndex} placeholder represents the entry's position among all entries. You can also use {visiblePanelIndex} to show the entry's position among visible entries, which is useful if the entries have dynamic visibility.
Disable manual addition and removal of entries within the Dynamic Panel
  1. Go to the Data category and set the same Join identifier value you used earlier (i.e., family).
Specify a join identifier for the Dynamic Panel
  1. In the Conditions category, locate the Bindings property.
  2. Select the question whose selected choices should define the number of entries.
Bind the number of entries within the Dynamic Panel to the number of selected choices

Preview the form and select items in the first question. The Dynamic Panel will automatically add corresponding entries.

Preview the binding with the Multi-Select Dropdown

Pipe Selected Values into Nested Questions of the Dynamic Panel

If a question inside the Dynamic Panel collects the same data as the multi-select question, you can automatically populate it using the selected values. To do this:

  1. Select the Multi-Select Dropdown question.
  2. In the Data category, locate Store values in the following property.
  3. Enter a value name (for example, selected-family-member).
Set the value name for Store values in the following property
  1. Select the question inside the Dynamic Panel that should receive the value.
  2. In the Conditions category, locate the Default value expression property.
  3. Enter the following expression: displayValue('relatives-source', {panel.selected-family-member}), where:
    • displayValue() is a function that returns the display text of a selected choice.
    • relatives-source is the Question name of the multi-select question.
    • {panel.selected-family-member} references the stored value within the panel.
Set a default value using a selected choice option

Now, when a respondent selects an option, a new panel entry is created and the corresponding field is filled in automatically.

Preview of selected values piped into a nested question

How to Repeat a Group of Questions Based on a Numeric Input

To repeat a set of questions based on a number entered by a respondent in the previous question, follow these steps:

  1. Add a Single-Line Input question to your form.
  2. Set a Question name (ID), Question title, and, optionally, a Question description.
Add and configure a Single-Line Input question
  1. Set Input type to Number.
Set the input type to number
  1. Repeat steps 1-6 from the Configure the Dynamic Panel section.
  2. In the Conditions category, locate the Bindings property.
  3. Select the Question name of the Single-Line Input whose value should define the number of entries—for example, relative-source.

Preview the form and enter a number in the Single-Line Input field. The Dynamic Panel automatically creates that number of entries, so respondents see and complete exactly what is required.

Preview the binding with the Single-Line Input

See Also

Send feedback to the SurveyJS team

Need help? Visit our support page

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.