# SharinPix Form - Repeated Section

## Overview

{% hint style="info" %}
**Repeated Sections** allow administrators to define a section that users can add multiple times while filling out a form. This is useful when the same group of fields may need to be completed more than once, such as when recording deficiencies, assets, rooms, or inspection items.

Repeated Sections are configured in the [SharinPix Form Template Editor](https://docs.sharinpix.com/forms/form-elements/sharinpix-form-template-editor) and share the same core configuration options as standard **Sections**, including display styles and related behavior. For information about shared settings, refer to the [Section documentation.](https://docs.sharinpix.com/forms/form-sections-and-repeated-sections/sharinpix-form-sections-and-repeated-sections)

This documentation covers:

1. [Configuration options for the **Repeated Section** element](#configuration-options)
2. [How to set up a **Repeated Section** element](#configure-the-repeated-section)
3. [How to add default items](#default-repeated-sections)
4. [How to configure preset items](#preset-sections)
5. [Available actions for repeated section items](#repeated-section-item-actions)
6. [Demo: Air Conditioning Unit Inspection Form](#demo-air-conditioning-unit-inspection-form)
   {% endhint %}

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2Fo5ERgbTdhMQMeG9Mi7Xm%2FDOC%20SF%20-%201920%20x%201080%20(72).png?alt=media&#x26;token=e03418c3-2b3b-4448-b6b2-5d38e3066425" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FPpQiQ7gaYsklv0HL9jp4%2FDOC%20SF%20-%201920%20x%201080%20(73).png?alt=media&#x26;token=0a7ad4af-aee0-4ad6-b980-81113cf23118" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Tips:

* **Repeated Sections** are ideal for capturing multiple items of the same type, such as deficiencies, equipment, observations, or rooms.
* Use **Repeated Sections** to handle unknown quantities of input instead of pre-creating a fixed number of sections.
* **Repeated Sections** can be used to create Child Records on Salesforce. Refer to the documentation on [**Creation of Child Records With Form Sections**](https://docs.sharinpix.com/forms/form-sections-and-repeated-sections/create-child-records-with-form-sections) for more informatio&#x6E;**.**
  {% endhint %}

## Configuration Options

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FbzQCsdDZ3idz8nOAIwRG%2FDOC%20SF%20-%201920%20x%201080%20(74).png?alt=media&#x26;token=a3702e06-b46c-4a5b-890c-d372dd181eb8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FssKa48oPvygZMKFbpuf7%2FDOC%20SF%20-%201920%20x%201080%20(75).png?alt=media&#x26;token=1387816e-ca0d-4a59-99db-c813cc1f20fb" alt=""><figcaption></figcaption></figure>

### General Options

| Option                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Label                                               | Defines the display name of the **Repeated Section** element in the form.                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Label Formula                                       | Dynamically generates the label of the **Repeated Section** element based on field values or defined conditions.                                                                                                                                                                                                                                                                                                                                                                                            |
| API Name                                            | Unique identifier for referencing the **Repeated Section** Element in logic or formulas.                                                                                                                                                                                                                                                                                                                                                                                                                    |
| Edit Section                                        | Opens the section template for the **Repeated Section** element, where you can add and configure the elements that make up each item.                                                                                                                                                                                                                                                                                                                                                                       |
| Style                                               | Defines how items in the **Repeated Section** element are displayed in the form, such as [**Full Page**](https://docs.sharinpix.com/forms/sharinpix-form-sections-and-repeated-sections#full-page), [**Collapsible**](https://docs.sharinpix.com/forms/sharinpix-form-sections-and-repeated-sections#collapsible), [**Inline**](https://docs.sharinpix.com/forms/sharinpix-form-sections-and-repeated-sections#inline), or [**Table**](https://docs.sharinpix.com/forms/form-elements/form-features-table). |
| Label for each item                                 | Defines the display label for each item within the **Repeated Section** element. This label is shown for every added item unless overridden by an item label formula.                                                                                                                                                                                                                                                                                                                                       |
| Label formula for each item                         | Uses a formula to dynamically generate the label for each item in the **Repeated Section** element. For example, <mark style="color:$danger;">`"Room " + TEXT(index)`</mark> will display labels such as **Room 1**, **Room 2**, and so on.                                                                                                                                                                                                                                                                 |
| Configure background color of repeated title on PDF | Allows you to define a custom background color for the **Repeated Section** title in the generated PDF.                                                                                                                                                                                                                                                                                                                                                                                                     |
| Configure background color of sections title on PDF | Allows you to define a custom background color for the title of every item in the **Repeated Section** element in the generated PDF.                                                                                                                                                                                                                                                                                                                                                                        |

### Advanced Options

| Option                                                  | Description                                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| item apiName                                            | Sets a unique identifier for the repeated item. It is used for referencing in logic or formulas.                                                                                                                                                                                                                                                        |
| Use full width                                          | This option removes the width constraint when displaying the **Repeated Section** element on the form.                                                                                                                                                                                                                                                  |
| Sortable                                                | Allows item reordering with drag and drop                                                                                                                                                                                                                                                                                                               |
| Allow add sections when (formula)                       | Uses a formula to control whether users can add new items to the **Repeated Section** element. By default, adding items is allowed. If a formula is provided, it must return a Boolean value. Users can add items only when the formula evaluates to **true**.                                                                                          |
| Allow delete sections when (formula)                    | Uses a formula to control whether users can delete items from the **Repeated Section** element. By default, deleting items is allowed. If a formula is provided, it must return a Boolean value. Users can delete items only when the formula evaluates to **true**.                                                                                    |
| Enable duplication of sections                          | Allows you to configure when users can duplicate items in the **Repeated Section** element. This option uses a formula, and duplication is enabled only when the formula returns **true**.                                                                                                                                                              |
| Visible When                                            | [Conditional visibility](https://app.gitbook.com/s/5EvYRrLbUyvRh8o1jmMG/sharinpix-form/form-features-conditional-visibility) rule (show or hide the **Repeated Section** element and any item added based on a formula)                                                                                                                                 |
| Validation rule                                         | Defines the [validation criteria](https://docs.sharinpix.com/forms/form-elements/form-features-validations) that the **Repeated Section** element must satisfy. This can be used to enforce conditions on the collection of items. For example, <mark style="color:$danger;">`rooms.size > 3`</mark> ensures that more than three room items are added. |
| Preserve value from previous submissions when (formula) | Uses a formula to determine whether previously entered item values are kept when the form is relaunched. By default, values from previous submissions are preserved. If a formula is provided, it must return a Boolean value, and previous values are preserved only when the formula evaluates to **true**.                                           |
| Pull data from a Salesforce record                      | Configuration for defining a mapping that will be used for prefilling the questions found inside the section using data from a Salesforce record.                                                                                                                                                                                                       |
| Create a Salesforce record                              | Configuration for creating Salesforce child records using data from each of section items. Refer to [this documentation](https://docs.sharinpix.com/forms/form-sections-and-repeated-sections/create-child-records-with-form-sections) for more information.                                                                                            |
| External field mapping                                  | Option for specifying a question found in the template section that will be used to store an external ID. This is useful for updating Salesforce records.                                                                                                                                                                                               |

## Configure the Repeated Section

Each item in **Repeated Section** is based on a **Section Element** template.

To configure the **Section Element:**

1. Click on the **Edit section** button on the **Repeated Section** element settings.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FbRoVkix8nakEFpja5Bfv%2FDOC%20SF%20-%201920%20x%201080%20(84).png?alt=media&#x26;token=9020cb05-f33b-4a0a-9941-cf7f31ded15b" alt=""><figcaption></figcaption></figure>

2. In the section editor, use the left sidebar to add the elements you want to appear in every section item.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FIr4X3Eyjk49e0ufbtqdA%2FDOC%20SF%20-%201920%20x%201080%20(85).png?alt=media&#x26;token=76b32b43-7b22-4d76-8065-34a536d05a88" alt=""><figcaption></figcaption></figure>

The image below shows a **Repeated Section** element configured using the section template above.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FPVKybVnWlEgTM1fGh23j%2FDOC%20SF%20-%201920%20x%201080%20(86).png?alt=media&#x26;token=b7e43aab-138e-474f-8e6d-1e384a19a604" alt=""><figcaption></figcaption></figure>

## Default Repeated Sections

You can configure **default repeated items** for a **Repeated Section** element so that one or more items are already available when the form opens.

To configure default items, open the **Default** tab in the **Repeated Section** element settings and click the **+** button to add a default item.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FNvRZ6WN5ODhBGLyhR274%2FDOC%20SF%20-%201920%20x%201080%20(1920%20x%20600%20px)%20(3).png?alt=media&#x26;token=8ac94ea8-9d81-4cf1-8711-c8f60ad9f276" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FFNfqW6O5EYcovZmeIsNN%2FDOC%20SF%20-%201920%20x%201080%20(80).png?alt=media&#x26;token=9c387bd1-4aad-4e22-a66e-b95c01b57d79" alt=""><figcaption></figcaption></figure>

The image above shows a **Repeated Section** element with two default room items added.

## Preset Sections

**Preset Sections** allow you to define pre-configured sections or items that users can choose from when adding a new item to a **Repeated Section** element. Instead of adding a blank item, users select from a list of preset options, and the new item is added with the predefined values and structure.

You can configure preset items from the **Presets** tab in the **Repeated Section** element settings. Click the **+** button to add a preset item, then define its label and default values.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FHqP00jPTzQCWrdjqQXKh%2FDOC%20SF%20-%201920%20x%201080%20(1920%20x%20600%20px)%20(4).png?alt=media&#x26;token=2c6e32b2-2933-4e23-ae28-dfa155573c57" alt=""><figcaption></figcaption></figure>

The images below illustrate two preset items configured for the **Repeated Section** element, labeled "Kitche&#x6E;**"** and "Bedroo&#x6D;**"** each having a different having for the **Name** field.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FCe4fBeNp2POH8CWJvX2t%2FDOC%20SF%20-%201920%20x%201080%20(81).png?alt=media&#x26;token=2022a715-7e0c-4e5e-b7b4-32f732cc4427" alt=""><figcaption></figcaption></figure>

When preset items are configured, the **+** button becomes a picklist showing the available presets. Selecting a preset adds the corresponding pre-configured item to the **Repeated Section** element.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FSKTZ108YtaJYBAGg6azL%2FDOC%20SF%20-%201920%20x%201080%20(83).png?alt=media&#x26;token=f0d5af8f-e183-402b-b23a-e1623b792b74" alt=""><figcaption></figcaption></figure>

### Preset Configuration Options

| Option       | Description                                                                             |
| ------------ | --------------------------------------------------------------------------------------- |
| Label        | Sets the label of the preset item as it appears in the **Add** button picklist.         |
| Visible when | Uses a formula to control when the preset item is shown in the **Add** button picklist. |

## Repeated Section Item Actions

The image below illustrates the available actions for individual items in a **Repeated Section** element.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FcoFex6gZrC0u8TtNZJNP%2FDOC%20SF%20-%201920%20x%201080%20(88).png?alt=media&#x26;token=abd1a088-1cd8-4caa-832b-3e7aa9617a42" alt=""><figcaption></figcaption></figure>

1. The **Delete item** action removes the selected item from the **Repeated Section** element. Deleting items is enabled by default, but it can be controlled using the **Allow delete sections when (formula)** setting.<br>
2. The **Reorder item** action allows users to change the order of items in the **Repeated Section** element. Users can click and drag the reorder handle next to an item to move it to a new position. This action is available when the **Sortable** option is enabled.<br>
3. The **Duplicate item** action creates a copy of the selected item, including its current values. This action can be controlled using the **Enable duplication of sections** setting.

{% hint style="warning" %}
The **Duplicate item** action does not duplicate images.
{% endhint %}

## Demo – Air Conditioning Unit Inspection Form

The image below shows a form configured with a **Repeated Section** element for recording multiple air conditioning units inspected within a building. The section or item template includes fields such as **Unit Number**, **Location of Unit**, **Any Leaks Detected**, and **Maintenance Performed If Any**, and is displayed using the **Inline** style. Two preset items have also been configured, **Small Unit** and **Big Unit**, each with its own predefined values.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FMvt4Y01bNuBL1JX5zp1K%2FDOC%20SF%20-%201920%20x%201080%20(89).png?alt=media&#x26;token=3f56e84d-c2ab-4b45-b350-15b22b245ba5" alt=""><figcaption></figcaption></figure>

The image below shows how air conditioning unit items can be added on the **Repeated Section** element using the **+** button.

<figure><img src="https://2647402409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrRD1Xcn9HtKcyfQ9Ghyk%2Fuploads%2FXO56TVkhlqdpOAacx9G7%2FDOC%20Mobile%20-%201920%20x%201080%20(6).png?alt=media&#x26;token=704b4286-04a4-4947-8219-78e27f6cd015" alt=""><figcaption></figcaption></figure>
