> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/7-komponenty-specjalne/sekcja-powtarzalna-repeatablesection.md).

# Repeatable section - RepeatableSection

Set of fields that can be filled in multiple times in the application by the user.

![](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/hzYmMQfUhU0Ho5gnZCnD/21s_files/image2025-5-16_11-47-17.png)

## Component properties

<table><thead><tr><th>Eximee Designer property</th><th width="187.583251953125">Attribute name in the Source</th><th>Description</th></tr></thead><tbody><tr><td><strong>Minimum number of section occurrences</strong><br>(section <strong>Basic properties</strong>)</td><td>minCount</td><td>Minimum number of occurrences of the repeatable section (initial value 1). When the application is displayed, this is also the number of occurrences that are visible and available by default. When removing section elements while filling out the application, you cannot go below this number. As the field value, you can enter a number (e.g. 3), an expression referring to the value of a variable or component (e.g. ${GesTextField1}), or a JS snippet (<a href="https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/dynamicznosc-formularza/wstawki-javascript.md">JavaScript snippets</a>).</td></tr><tr><td><strong>Maximum number of section occurrences</strong><br>(section <strong>Basic properties</strong>)</td><td>maxCount</td><td>Maximum number of occurrences of the repeatable section (initial value 5). When adding section elements, you cannot exceed this number. As the field value, you can enter a number (e.g. 3), an expression referring to the value of a variable or component (e.g. ${GesTextField1}), or a JS snippet (<a href="https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/dynamicznosc-formularza/wstawki-javascript.md">JavaScript snippets</a>).</td></tr><tr><td><strong>Title</strong><br>(section <strong>Basic properties</strong>)</td><td>title</td><td><p>Title.</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Title of the entire repeatable section</strong><br>(section <strong>Basic properties</strong>)</td><td>parentSectionTitle</td><td>Title for the entire repeatable section.</td></tr><tr><td><strong>Section collapse button label</strong><br>(section <strong>Others</strong>)</td><td></td><td><p>Section collapse button label.</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Section expand button label</strong><br>(section <strong>Others</strong>)</td><td></td><td><p>Section expand button label.</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Collapsible section</strong><br>(section <strong>Others</strong>)</td><td>foldable</td><td><p>Specifies whether the section should be collapsible (initially set to "false").</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Section collapse condition</strong><br>(section <strong>Others</strong>)</td><td>foldedCondition</td><td><p>Section collapse condition.</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Section expansion presentation mode</strong><br>(section <strong>Others</strong>)</td><td>presentation</td><td><p>Specifies how section expansion is presented. Available collapse/expand presentation types: STANDARD and LABELS (more detailed description below).</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Dynamic button labels</strong><br>(section <strong>Others</strong>)</td><td>plusMinusLabels</td><td>Conditions for the visibility of add/remove buttons for repeatable section elements.</td></tr><tr><td><strong>Section remove button label</strong><br>(section <strong>Others</strong>)</td><td>minusText</td><td>Label for the minus button (removal of a repeatable section element).</td></tr><tr><td><strong>Section add button label</strong><br>(section <strong>Others</strong>)</td><td>plusText</td><td>Label for the plus button (adding a repeatable section element).</td></tr><tr><td><strong>Expanded section title</strong><br>(section <strong>Others</strong>)</td><td>rowTitleExpanded</td><td><p>Title displayed for the expanded section.</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Collapsed section title</strong><br>(section <strong>Others</strong>)</td><td>rowTitleCollapsed</td><td><p>Title displayed for the collapsed section.</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr><tr><td><strong>Component border</strong><br>(section <strong>Others</strong>)</td><td>parentSectionFrameVisible</td><td><p>Setting the flag displays a frame around all occurrences of the repeatable section (initially set to "false").</p><p>Availability of the functionality depends on the license and may not be available in all deployments.</p></td></tr></tbody></table>

> More information about component properties: [Common component properties](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/wspolne-wlasciwosci-komponentow.md)

## Working with Repeatable Section

**Repeatable section** enables repeated display of the same set of components on the form. Within the section you can place base components, e.g. Text Field, List Value Selection Field, etc. Each occurrence of the section contains the same set of components, but can store different values.

The number of available section occurrences is determined by the properties **Minimum number of section occurrences** and **Maximum number of section occurrences**. The user can add further section occurrences while filling out the form or remove existing ones using the appropriate buttons.

In the example below, each occurrence of the Repeatable Section contains two Text Fields.

<figure><img src="https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/YBk7oFeuv7ywFUWuBLPp/21s_files/image2025-5-16_11-47-57.png" alt=""><figcaption><p><em><strong>Illustration 1.</strong> Example appearance of the component in the application</em></p></figcaption></figure>

{% hint style="warning" %}
In Repeatable Section you cannot use [session variables](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne.md) — here we use technical fields (e.g. the Text Field component with the property [Technical field](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/wspolne-wlasciwosci-komponentow.md)). Also, populating fields from a service in a repeatable section can cause unusual errors — e.g. incorrect display of components (but not necessarily). In such a situation, a workaround in the form of a technical field should be used.
{% endhint %}

### Repeatable section and data model

A repeatable section can take rows from a list in the data model. To configure this:

1. Select the Repeatable Section and in the field **Data model key** choose the list key, e.g. `klient.adresy[]`. The field suggests only lists to the section.
2. Select a component in the section and click its field **Data model key**. At the beginning of the list are the keys of the current section row, e.g. `klient.adresy[GesRepeatableSection1_rowIdx].miasto`.
3. Choose the key. In each section row, the component displays and saves the value from the list item in that row.

Marker `GesRepeatableSection1_rowIdx` is the section identifier with the suffix `_rowIdx`. While filling in the application, Eximee replaces it with the row number. Details and limitations, e.g. for nested sections, in the chapter [Handling array fields (lists)](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/praca-z-komponentami-bazowymi/model-danych-na-interfejsie.md#obsluga-pol-tablicowych-list).

## Populating a Repeatable Section with a script

To dynamically populate a **Repeatable Section**, use an external script. To do this, go to **Properties** of the component, select the **Interactions**, and then check **External data source**. This option allows you to select a script that will provide data to the component.

### Example of a script generating a repeatable list

The script below generates a list of repeatable sections of test data based on a given number of rows and optionally adds extra fields (min, max, count) to the first row if the appropriate flags are set.

```js

function callService(context) {
    const rowCount = parseInt(context.getFirstParameter('rowCount') || '0');
    const count = context.getFirstParameter('count');
    const min = context.getFirstParameter('min');
    const max = context.getFirstParameter('max');
    const returnCount = context.getFirstParameter('returnCount');
    const returnMin = context.getFirstParameter('returnMin');
    const returnMax = context.getFirstParameter('returnMax');

    const result = [];

    for (let i = 0; i < rowCount; i++) {
        result.push({
            field1: `field1_${i}`,
            field2: `field2_${i}`,
            field3: `field3_${i}`,
        });
    }

    if (returnMin =="true" && min.trim() != '') {
        if (result.length == 0) result.push({});
        result[0]['min'] = min;
    }

    if (returnMax =="true" && max.trim() != '') {
        if (result.length == 0) result.push({});
        result[0]['max'] = max;
    }

    if (returnCount =="true" && count.trim() != '') {
        if (result.length == 0) result.push({});
        result[0]['count'] = count;
    }

    return result;
}
```

A key step after selecting the data source is the proper configuration of the information flow:

* field mapping - make sure that the script's input parameters (e.g. the field specifying the number of rows) are correctly linked to the components on the application. Likewise, the script's output parameters (returned data) must be assigned to specific component attributes,
* listeners - remember to add listeners to components that trigger a change. Thanks to them, the script will run automatically and reload the section as soon as the user changes a value on the form (e.g. enters a different number of repetitions).

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-98808a381bad1a9b922b8b6f286233cb46adb897%2Fsekcja-pow1.png?alt=media" alt=""><figcaption><p><em><strong>Illustration 2.</strong> Method of populating the repeatable section with a script</em></p></figcaption></figure>

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-28a09284c5fb0cbf61b7a2d22ceb399eb900f83c%2Fsekcja-pow3.png?alt=media" alt=""><figcaption><p><em><strong>Illustration 3.</strong> Script output parameters</em></p></figcaption></figure>

After the script has been correctly attached and mapped, the component's behavior becomes fully dynamic. The form will automatically generate and display the exact number of repeatable sections according to the logic encoded in the code.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2Fgit-blob-579dfac06815b80e46923ae64116de94d74cd26c%2Fsekcja-pow2.png?alt=media" alt=""><figcaption><p><em><strong>Illustration 4.</strong> Repeatable section with repetition count control (populating the section with a script)</em></p></figcaption></figure>

## Example of a Repeatable Section with values to sum

When we want to sum values from a repeating Text Field component in **Repeatable Section**, we add another Text Field outside the section and in its properties we attach in the **External data source** the SumService script:

```javascript
function callService(context) {
    let parts = context.getParameters('parts');
    
    let result = BigDecimal.valueOf("0");
    
    if (!!parts) {
        for (let i = 0; i < parts.size(); i++) {
            let part = parts.get(i);

            if(!!part){
                let bigDecimalItem = BigDecimal.valueOf(part.replace(',','.'));
                result = result.add(bigDecimalItem);
            }
        }
    }
    
    return [{'output': result.setScale(2)}];
}
```

In the script's input parameters, we attach the repeating component with values to be summed, and in the output parameters we select output, i.e. the sum of values, as the text attribute.

<figure><img src="https://2112972046-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2CssJT0zIo4SJQLbSZ6l%2Fuploads%2F6EIbQrxrzpbekDYZyQ3i%2Fobraz.png?alt=media&amp;token=a5cae498-992b-4bb1-8868-f8f6af9d1070" alt=""><figcaption><p><em><strong>Illustration 5.</strong> Binding the output parameter in the SumService script</em></p></figcaption></figure>

{% hint style="info" %}
Demo applications:

* demoRepeatableSection
* repeatable\_section\_service (an application showing section population with a service or script)
* demoRepeatableSectionValidator (an application with a validator for repeating values in the section)
  {% endhint %}

{% hint style="info" %}
♿WCAG: [WCAG best practices for low-code development](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/proces-biznesowy/tworzenie-procesu-biznesowego-w-bpmn-2.0/dobre-praktyki.md)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/7-komponenty-specjalne/sekcja-powtarzalna-repeatablesection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
