--- title: "Grid: Fill" slug: "freaction-fill-grid" updated: 2026-05-05T12:14:54Z published: 2026-05-05T12:14:54Z canonical: "docs.lobstersoftware.com/freaction-fill-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: Fill *See also:* [Grid: Clear](/v1/docs/en/freaction-clear-grid), [Grid: Add row(s)](/v1/docs/en/freaction-add-to-grid), [Grid: Remove row](/v1/docs/en/freaction-remove-from-grid) > [!NOTE] > **Actions – Abstract** > > The action [Grid: Fill](/v1/docs/en/freaction-fill-grid) populates the rows of a [Data grid](/v1/docs/en/fre-data-grid-vo) linked as a **Target element** with data from a list. Any existing content in the [Data grid](/v1/docs/en/fre-data-grid-vo) will be overwritten. ![images/download/attachments/189433873/image-2024-10-10_12-31-34-version-1-modificationdate-1728556294310-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-10-10_12-31-34-version-1-modificationdate-1728556294310-api-v2.png) The action [Grid: Fill](/v1/docs/en/freaction-fill-grid) populates the rows of a [Data grid](/v1/docs/en/fre-data-grid-vo) linked as a **Target element** with data from a list. Any existing content in the [Data grid](/v1/docs/en/fre-data-grid-vo) will be overwritten. Existing "rows" in the target element are discarded. **IMPORTANT:** The specification of a target element from the [Data grid](/v1/docs/en/fre-data-grid-vo) type is required so that this action can be selected under **Action type**. *List data* for filling a [Data grid](/v1/docs/en/fre-data-grid-vo) element can be obtained by different methods and from different sources, which are described below using examples. The list data for the action [Grid: Fill](/v1/docs/en/freaction-fill-grid) is either provided by the executing element itself (via a suitable [Events (Form designer)](/v1/docs/en/fretrigger)) or as a return value of a suitable behavior. - Alternatively, a data grid can of course be filled independently of the action by assigning suitable element data, e.g. if an event handler returns suitable content for the data field of the data grid using the variable `formData` which is mapped to a parent container by a [Dispatch custom action event (Form designer)](/v1/docs/en/frebehav-dispatch-custom-action-event) behavior via [Populate element data](/v1/docs/en/freaction-populate-data). - For other [List elements](/v1/docs/en/fre-list-elements), however, the data field (or the value of the element) corresponds to a single or multiple selection, while the list data defines the "rows" that can be selected. If necessary, the service configuration (see [Services and converters](/v1/docs/en/fre-services-converters)) for the target element regulates the interaction. Regardless of the data source and the method used to obtain the list data, the filled [Data grid](/v1/docs/en/fre-data-grid-vo) only displays the contents of these list entries that match the existing column configuration (especially data fields, calculation expressions). The data structure of the entries is nevertheless completely stored in the element data and is available for [Behaviors](/v1/docs/en/frebehaviours), [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration) and [Calculation field](/v1/docs/en/fre-calc) etc. Depending on the data source, this can also affect complete entities (business objects, configuration objects, etc.) as an entry in a list. Input data for the action [Grid: Fill](/v1/docs/en/freaction-fill-grid) must correspond to one of the following structures so that the [Data grid](/v1/docs/en/fre-data-grid-vo) is filled line-by-line: | Input data structure | Example/Description | | --- | --- | | **Text (XML)** A string that results in a valid XML document from which to deserialize an object whose structure matches one of the following definitions. | *Example for text that can be interpreted as content for a grid via XML:* ```plaintext ... ... ... ``` --- The internal structure per "item" (`...`) can be individually designed as complex as desired. Details on processing the XML structure on the way to the [Data grid](/v1/docs/en/fre-data-grid-vo) are further explained in the "Examples" section below. | | **Anonymous object with a single field of the "Array" type** This complicated-looking designation describes what is actually a fairly simple structure, for example, when deserializing an object from an XML document like the one in the previous example in **Lobster Data Platform/Orchestration**. | *JSON representation of the object from the above XML:* `{ item : [ ... , ... , ... ] }` Child elements with identical names are interpreted as an array. The name of the child element appears as the field name, while the name of the root element does not appear. --- [Grid: Fill](/v1/docs/en/freaction-fill-grid) transfers the contents (`...`) from the array (*here*: object field *item*) into the rows of the [Data grid](/v1/docs/en/fre-data-grid-vo) elements. The contents displayed by the portal at runtime depends on the interaction between the data field assignment in the configuration column and the contents of the array element. The [Data grid](/v1/docs/en/fre-data-grid-vo) defines a "projection" of the actual contents into a list structure. | | **Native array** The [Grid: Fill](/v1/docs/en/freaction-fill-grid) action can also process an array that is not "packed" as an anonymous object field but is passed directly (as an object of the "array" type. **NOTE:** A corresponding structure cannot be created from an XML text because the XML format requires a single root element. If a lobster_data profile in JSON format returns multiple records, (e.g. [Call profile](/v1/docs/en/frebehav-call-profile)) the behavior typically returns this data as a native array. | *Output value of the console for a* [Data grid](/v1/docs/en/fre-data-grid-vo) *with two rows:* ![images/download/attachments/189433873/image2020-4-6_8-53-21-version-1-modificationdate-1728555708632-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-6_8-53-21-version-1-modificationdate-1728555708632-api-v2.png) --- In the example, the [Validate element](/v1/docs/en/frebehav-validate) behavior element was used to read the contents of a data grid that lists complete business objects. The returned array in business objects can be assigned directly to another data grid via [Grid: Fill](/v1/docs/en/freaction-fill-grid). | | **Collection** When the [Grid: Fill](/v1/docs/en/freaction-fill-grid) action passes a collection object, it uses the (native) array contained in the collection to fill the grid. | *Console output value for the (*`lineItems`*) of a business object:* ![images/download/attachments/189433873/image2020-4-6_10-20-43-version-1-modificationdate-1728555708638-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-6_10-20-43-version-1-modificationdate-1728555708638-api-v2.png) The object transferred is of the `ArrayCollection` type and contains a native array of objects of positions in the data buffer (`_buffer`) for the business object type. --- In the example (above), the (`lineItems`) of a business object were written to the console as behavior data. This data is suitable, via [Grid: Fill](/v1/docs/en/freaction-fill-grid), to populate the business object items within a portal and to list selected characteristics of these items in a [Data grid](/v1/docs/en/fre-data-grid-vo). | | **Data provider** A collection object, with the native array it contains, is often provided as part of a data provider object. In this two-step "packaging" the [Grid: Fill](/v1/docs/en/freaction-fill-grid) action also uses the contained array to fill the grid. | *The console output value for the return value of a behavior that returns business objects from a search:* ![images/download/attachments/189433873/image2020-4-6_10-45-13-version-1-modificationdate-1728555708641-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-6_10-45-13-version-1-modificationdate-1728555708641-api-v2.png) | ## Examples ### Fill data grid with list data from a Lobster profile A Lobster profile can be called synchronously from a form using the behaviors [Call profile](/v1/docs/en/frebehav-call-profile) or [Validate element and call profile](/v1/docs/en/frebehav-validate-call-profile). If the called profile provides a suitable return value when called directly in the [Behaviors](/v1/docs/en/frebehaviours), this value is immediately available for the action [Grid: Fill](/v1/docs/en/freaction-fill-grid). In the simplest case, the profile provides a target file in JSON format, which defines a list (`[... , ...]`) of objects ( `{ ... }` ) with information about the same name-value pairs ( `<name> : <value>, ...` ). The following example illustrates this structure: JSON target file for filling a grid ```plaintext [{"id":"1", "name":"I", "description":"Category I: Required data"}, {"id":"2", "name":"II", "description":"Category II: Optional details"}, {"id":"3", "name":"III", "description":"Category III: Attachments"}] ``` A data grid whose column configuration refers to the `id`, `name` and `description` data fields, lists the corresponding values in a table: ![images/download/attachments/189433873/image2020-4-11_11-45-9-version-1-modificationdate-1728555708672-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-11_11-45-9-version-1-modificationdate-1728555708672-api-v2.png) ### Fill data grid with data from an object selection via a multi-combobox In a portal a [Multiselect combobox](/v1/docs/en/fre-multi-select-combo-box-vo) allows the selection of [Companies/Clients](/v1/docs/en/base-company-account). Certain details of the selected company accounts should be displayed in a [Data grid](/v1/docs/en/fre-data-grid-vo). Both elements are arranged in an [Expandable](/v1/docs/en/fre-expandable-vo) container so that the selection ([Multiselect combobox](/v1/docs/en/fre-multi-select-combo-box-vo)) is always visible and the details ([Data grid](/v1/docs/en/fre-data-grid-vo)) can be opened and closed as required. Runtime sample: ![images/download/attachments/189433873/image2020-4-6_14-24-41-version-1-modificationdate-1728555708663-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-6_14-24-41-version-1-modificationdate-1728555708663-api-v2.png) Configuration: ![images/download/attachments/189433873/image2020-4-6_14-26-17-version-1-modificationdate-1728555708665-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-6_14-26-17-version-1-modificationdate-1728555708665-api-v2.png) - A behavior for the [Multiselect combobox](/v1/docs/en/fre-multi-select-combo-box-vo) responds to the **trigger** [Changed](/v1/docs/en/fretrigger-changed) with all **change** **types** and [Static](/v1/docs/en/frebehav-static) **behavior**, so that the [Data grid](/v1/docs/en/fre-data-grid-vo) is always filled (or emptied) according to the selection. - Under **Actions on "true"** the action [Grid: Fill](/v1/docs/en/freaction-fill-grid) is executed with the [Data grid](/v1/docs/en/fre-data-grid-vo) as the **target element**. The columns in the [Data grid](/v1/docs/en/fre-data-grid-vo) refer to the following data fields of the company account: | Column | Data field | | --- | --- | | **Name 1** | `address.name1` | | **Country** | `address.countryCode` | | **Zip code** | `address.zipcode` | | **City** | `address.city` | | **Company types** | `types` | ### Fill data grid starting from a text in XML format *The following example has no direct practical relevance, but should make some technical details about the transfer of XML text in list data clearer to understand.* ![images/download/attachments/189433873/image2020-4-6_14-30-16-version-1-modificationdate-1728555708668-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2020-4-6_14-30-16-version-1-modificationdate-1728555708668-api-v2.png) - The input in the [Text field](/v1/docs/en/custom-custom-text-field) **Text field** (top left) is transferred via [Grid: Fill](/v1/docs/en/freaction-fill-grid) action to the **Data grid (List)** element below when the **Grid: Fill** button is clicked. - When you select a row in the [Data grid](/v1/docs/en/fre-data-grid-vo), the value of the relevant row is shown as [Show alert](/v1/docs/en/freaction-show-alert). - The **Structure Export** [Text field](/v1/docs/en/custom-custom-text-field) (right) shows the content for the entire portal, which was interactively copied there for this purpose. This example illustrates the following rules and relationships for the interpretation of text in a [Data grid](/v1/docs/en/fre-data-grid-vo) whose columns use the data fields `@col1` and `col2`: 1. The name of the XML root element is not important for the further interpretation of the data. The name can even be identical to that of the direct child elements (*here:* `stuff`). 2. The different structure of the `stuff` child elements demonstrates different ways to assign values to data fields with a specific name: 1. The first element assigns a data field with the name `@col1` the text value `foo` by displaying it as an XML attribute `col1`. The content for the second column is defined by the text content of a child element named `col2`. 2. The second element (`</stuff>`) is empty and gives no visible values in the grid. However, in this case, a calculation expression for the first column assigns the string "" as a value. 3. The third element again uses the schema of the first element: An XML attribute `@col1` and a child element `col2` return text values. The fourth element does not provide any starting points for field names, since here there is only direct text content. The appearance in the [Data grid](/v1/docs/en/fre-data-grid-vo) corresponds to the empty element (b), but the literal text value is available in the element data (see the blue marker in the **Structure Export**), so that, for example, the [Show alert](/v1/docs/en/freaction-show-alert) action (as shown in the screenshot) can work with this data.