--- title: "Grid: Add row(s)" slug: "freaction-add-to-grid" updated: 2026-05-05T12:49:19Z published: 2026-05-05T12:49:19Z canonical: "docs.lobstersoftware.com/freaction-add-to-grid" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Grid: Add row(s) *See also:* [Grid: Fill](/v1/docs/en/freaction-fill-grid), [Grid: Clear](/v1/docs/en/freaction-clear-grid), [Grid: Remove row](/v1/docs/en/freaction-remove-from-grid), [Grid: Replace selected rows](/v1/docs/en/freaction-update-selected-grid-rows) > [!NOTE] > **Actions – Abstract** > > The [Grid: Add row(s)](/v1/docs/en/freaction-add-to-grid) action adds one or more rows from a [Data grid](/v1/docs/en/fre-data-grid-vo) linked as a **Target element** or one of the other [List elements](/v1/docs/en/fre-list-elements) if the service configuration of the target element allows this. The action [Grid: Add row(s)](/v1/docs/en/freaction-add-to-grid) adds one or more rows from a [Data grid](/v1/docs/en/fre-data-grid-vo) linked as a **Target element** or one of the other [List elements](/v1/docs/en/fre-list-elements) if the service configuration of the target element allows this. ![images/download/attachments/189434207/image-2024-10-14_9-29-31-version-1-modificationdate-1728890971213-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-14_9-29-31-version-1-modificationdate-1728890971213-api-v2.png) **IMPORTANT:** The specification of a target element from the group of [List elements](/v1/docs/en/fre-list-elements) is required so that this action can be selected under **Action type**. The rows to be added to the **Target element** must exist as input data (`$input`) for the action. - The **Update if contained** is set by default. This setting checks whether the corresponding data item is already contained in the **Target element** for each row to be added. If this is the case, the relevant entry in the **Target element** is updated with data from the `$input`. However, an object with identical content (for example, a copy of the original) is not considered a match. - If the **Update if contained** option is not set, the rows to be added are always added to the **Target element** as a copy. ## Example In connection with a truck transport, information on the vehicle type of the tractor truck is to be entered via the portal. The standard tractor trucks available in the company"s own fleet are stored as options in a [Combobox](/v1/docs/en/fre-combo-box-vo) element (with the "Options" display type). If necessary, it should also be possible to add data for non-standard tractor trucks "spontaneously" – i.e. without creating additional master data. These should appear as an additional option in the [Combobox](/v1/docs/en/fre-combo-box-vo) element for the respective transport. If the relevant option is selected, the stored detailed data should be displayed again so that corrections can be made if necessary. Runtime example: - Initially, the form offers three standard tractor truck types to choose from: ![images/download/attachments/189434207/image2020-7-8_13-43-9-version-1-modificationdate-1728888254718-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-7-8_13-43-9-version-1-modificationdate-1728888254718-api-v2.png) - Clicking on the **Additional type?** [Button](/v1/docs/en/fre-button-vo) displays a [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) for entering details for an additional tractor truck type: ![images/download/attachments/189434207/image2020-7-8_13-46-16-version-1-modificationdate-1728888254724-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-7-8_13-46-16-version-1-modificationdate-1728888254724-api-v2.png) - If the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) **Non-standard-tractor** contains valid data (*here*: all required fields are filled in), a click on the **Submit** [Button](/v1/docs/en/fre-button-vo) adds the corresponding entry as an additional option for **Tractor truck (type)**, then selects it and hides the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) **Non-standard-tractor** again: ![images/download/attachments/189434207/image2020-7-8_13-47-37-version-1-modificationdate-1728888254727-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-7-8_13-47-37-version-1-modificationdate-1728888254727-api-v2.png) The data structure of a tractor type in the [Combobox](/v1/docs/en/fre-combo-box-vo) element with the `truck` data field becomes clear with this addition in the structure export for the portal: ```plaintext {    "truck": {        "type": "FERRARI FYT",        "hp": 220,        "registration": "Y-123456"    } } ``` The detailed data fields for "Type" (`type`) and "Power (HP)" (`hp`) are also used in the default entries that were entered in the example as "Static values" in the service configuration for the [Combobox](/v1/docs/en/fre-combo-box-vo) element. The required information "registration number" (`registration`) is only used for non-standard tractor truck types, so that a value for this characteristic identifies the entry as "non-standard type". In the "Label expression" within the service configuration, an attached asterisk appears, as shown in the screenshot (*). Configuration: | ![images/download/attachments/189434207/image-2024-10-14_9-37-18-version-1-modificationdate-1728891438327-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-14_9-37-18-version-1-modificationdate-1728891438327-api-v2.png) | For the **Additional type?** [Button](/v1/docs/en/fre-button-vo), next to the **Tractor truck (type)** [Combobox](/v1/docs/en/fre-combo-box-vo), the behavior shown on the left is configured to display and initialize the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) with the "Non-standard-tractor" details: - The behavior reacts to the **Triggering event** [Click](/v1/docs/en/fretrigger-clicked) which provides the default value `$true` as `$input`. This is exceptionally important because this behavior can also be called by a [Execute behavior](/v1/docs/en/freaction-execute-behaviour) action, which then provides the currently selected tractor truck type as `$input`. --- - The **Behavior type** [Calculate](/v1/docs/en/frebehav-calculate) was chosen to determine by means of a **Check expression** whether the value `$true` is available as `$input` or not. The **Actions on "true"** are only executed if this is the case, i.e. if the "Additional type?" [Button](/v1/docs/en/fre-button-vo) was pressed. The **Actions on "false"** are executed if the behavior was called because a "Non-standard-tractor Type" was interactively selected for the tractor in the [Combobox](/v1/docs/en/fre-combo-box-vo) "Tractor truck (type)", the data of which should then appear in the details area. --- - Under the **Actions on "true"**, the action [Populate empty element data](/v1/docs/en/freaction-populate-empty-data) is executed with the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) "Non-standard-tractor" as the **Target element**, so that this is initialized with an empty data item and can be used to maintain data for a new type. Subsequently, the same **Target element** is made visible via [Show element](/v1/docs/en/freaction-show) and the **Additional type?** [Button](/v1/docs/en/fre-button-vo) is set to invisible via [Hide element](/v1/docs/en/freaction-hide). --- - The **Actions on "false"** follow the same pattern, except that in the first step the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) is not initialized with empty element data. Instead, the input data (`$input`) is set to the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) using [Populate element data](/v1/docs/en/freaction-populate-data), i.e. the data of the tractor truck type selected by the [Combobox](/v1/docs/en/fre-combo-box-vo) when the behavior is called (not in the screenshot). This data can then be updated as required by pressing the "Submit" [Button](/v1/docs/en/fre-button-vo) (see below). | | --- | --- | | ![images/download/attachments/189434207/image-2024-10-15_8-7-7-version-1-modificationdate-1728972427228-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-15_8-7-7-version-1-modificationdate-1728972427228-api-v2.png) | For the "Submit" [Button](/v1/docs/en/fre-button-vo) in the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) for the definition of a "Non-standard-tractor" the behavior shown on the left is configured: - The behavior reacts to the **Triggering event** [Click](/v1/docs/en/fretrigger-clicked). --- - The **Behavior type** [Validate element](/v1/docs/en/frebehav-validate) checks the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) linked as the **Target element** "Non-standard-tractor". Only if all contained elements are filled in a valid way, the **Actions on "true"** are executed with the validated data. If entries are missing or invalid, a click on "Submit" – as long as no **Actions on "false"** are defined – is ineffective. --- - Under the **Actions on "true"**, the action [Grid: Add row(s)](/v1/docs/en/freaction-add-to-grid) is executed with the [Combobox](/v1/docs/en/fre-combo-box-vo) "Tractor truck (type)" as the **Target element**. The **Update if contained** option is set so that corrections (see above) can be made to an already inserted entry without creating a duplicate. --- - After adding the new option, it will be assigned as a selection by [Set value](/v1/docs/en/freaction-set-value) with the same **Target element**. The **Value** refers to the `$input` that contains the added data item. --- - The action [Hide element](/v1/docs/en/freaction-hide) (collapsed in the screenshot) with the [Column layout](/v1/docs/en/fre-row-element-container-vo-column-layout) "Non-standard-tractor" as the **Target element** hides the details area again. --- - The action [Show element](/v1/docs/en/freaction-show) (collapsed in the screenshot) refers to the **Additional type?** [Button](/v1/docs/en/fre-button-vo) as the **Target element**, which is hidden when the details area is displayed and should become visible again after "Submitting" the details. |