Repeating sections and pages can be driven by a Data question or a File Selection question when the question is set to return multiple rows or files. If there are 10 rows in the data connection then repeating section will show 10 rows.
You can also have questions under your repeat that reference the data source question and they will get the appropriate value for that row. For example, a text field default value references the data source answer. For each row in the repeat, the default value becomes the value from the same row in the data source.
Design: New option on repeating sections and pages to choose how the rows are constructed "Driven By". The options are "Manual", "Data" and "Data with add and remove".
Step 1: Create a Data Source question.
Step 2: Set the selection type as Multiple Rows and configure the question appropriately (Only enabled for multiple row Data Source question
Step 3: Insert a Section and Column. In the Section properties select Repeating. Additional options will pop up.
Just having Repeating selected, it repeats the set of questions that exist in the repeating section as many times as the end user needs and you also get the option to enter max and min rows. Refer to Article Repeating Sections
When "Data Driven" is selected the Max, Min and Show controls are hidden and a new drop-down is shown that displays multi-select data source questions that come before the repeat item.Selecting a data source question from the drop-down will now connect the Repeating Section to that Data Source. Repeat rows will be created as soon as the project is launched.
If a data source changes the number of rows it has, those rows will be added or deleted from the end of the repeat. If a data row is deselected the same row in the repeat will be removed preserving all other rows.
When child questions of the repeat reference the data question, they will only get a single data value from the same row that the child question is in. When a question outside of the repeat references the data question the result will be all of the selected values as before.
The single value mode is enabled for question references in text and defaults, conditions, filters, and rules.
Data when this option is selected, the number of rows in the Repeating Section will be same as the number of rows in the Data Source and any references in the Repeating Section to the Data Source will be calculated on a per-row basis.
In Produce, Repeating section set to "Data" will not display the Add, Delete, Fill Down or Import buttons. For repeat pages the Add and Delete buttons do not display. As Row creation is purely based on Data Source, as a result data-driven sections and pages cannot have their rows modified. Only by changing the data source's selections rows will be modified.
When Data source initially starts with zero rows, the data-driven repeating page might show a blank page.
When Allow Add and Remove selected, Data-driven sections and pages can have their rows modified. This option can be used when the data source is hidden or if you want to add additional rows to the list.
In Produce, Repeating Section set to "Data Driven" and "Allow Add and Remove" will display Add, Delete, Fill Down and import buttons. For repeat pages the Add and Delete buttons will also display.
When you add a manual row using Add button, the question references to the data source question will return a blank string for manually added rows. It is common for questions under the repeat to have data references to show the user what is in the database. When you add a section row manually it is not tied to a data source row and so those references cannot be resolved for manually added rows.
Also note, that modifying the data source's selection will bring back previously deleted section rows. This is essentially a resync of the section rows to the data sources selections. Manually added rows will be untouched.
Step 4: after selecting Driven by option, create a Label (or a Text Field) and refer them to an answer in the Data Source question.
Step 5: Save changes and run your project in Produce.
When a File Selection question is set to "Multiple" the end user will be able to upload multiple documents to answer the question. If a Designer wants to ask additional questions for each uploaded document then they would use a Data-driven repeating section which specifies the source as the source File Selection question to get the corresponding rows and data.
- Create a File Selection question and check the "Multiple" box, note the name of this Question is "Supporting Documentation"
- Insert a Section and Column. In the Section properties select Repeating. Additional options will pop up.
- When "Data Driven" is selected the "Source" dropdown is shown which has a list of all multiple row data questions and multiple file selection question names. Select the File Selection question, in this case, "Supporting Documentation"
- As the user uploads attachments to the File Selection question, corresponding rows will be added to the section. If the files uploaded to the question changes the number of rows it has, those rows will be added or deleted.
When child questions (those within the section created) of the repeat reference the File Selection question, they will get a single data value from the same row that the child question is in.
The single value mode is enabled for question references in text and defaults, conditions, filters, and rules for questions within the created section.
After selecting Driven by option, create a Label (or a Text Field) and refer them to an answer in the Data Source question.
- Within Design, the section will display as a single row of the output in Produce.
Updated 5 months ago