> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Row and root keys in collections and tables

> Use item:, parent: and bare keys inside collection items and table rows, and write row action results back into the row they started on.

Inside a collection item or a table row, a key says where its data lives: in the current row, in the enclosing row, or at the screen's data root. The prefix decides it, so the same key resolves the same way wherever the component sits.

| Key | Reads from | Example |
| - | - | - |
| `item:<field>` | The current row (the collection item or table row the component is painted in) | `item:name` |
| `parent:<field>` | The enclosing row, one level up, in a nested collection | `parent:customerId` |
| `<field>` (no prefix) | The screen's data root, even inside a row | `currency` |

> [!WARNING]
>
> **A key without a prefix no longer reads the row.** On FlowX.AI 6.0.0 and earlier, a bare key such as `name` inside a collection prototype resolves against the current item, and there are no `item:` or `parent:` keys, **Row identifier key** or **Current row** settings. Now a bare key always reads the data root, and a row field needs `item:`. FlowX.AI SaaS already works this way, and self-hosted installations get it in the next LTS release. Upgrading rewrites the keys stored in your screens, see [Upgrading and importing](#upgrading-and-importing).

***

## Which fields take which keys

Every key field inside a row falls into one of four groups. The Designer checks each field when you type a key and shows the message from the last column when the key doesn't fit.

| Field kind | Accepted inside a row | Examples | Designer message |
| - | - | - | - |
| **Row only** | `item:` only | Data key of a form field (input, select, checkbox and so on), custom component input keys, the source of a collection or table nested in a row | `Inside a row, start the key with "item:", for example "item:name".` |
| **Row or root** | `item:` or a bare key | Image source key, file source key, **Prototype identifier key** (key-value selection) | |
| **Root only** | Bare keys only | **Row item save key** (Save local variable), action **Custom body** | `This field always writes to the process data root. Use a key without "item:" or "parent:".` |
| **Permission rules** | Bare keys only | Hide and disable permission rules on a component | `Permission rules read the process data root. Use a key without "item:" or "parent:".` |

Expressions (labels and text with `${}`, computed values, hide and disable conditions, validator messages, local scripts, start params, URLs, the prototype selection condition) can mix all three forms: `${item:price} * ${vatRate}` reads the row's price and the root's VAT rate. A root value no longer needs a workaround such as `additionalData` to be read from inside a row.

An `item:` or `parent:` key that can't be resolved at runtime renders empty and is logged; it doesn't break the screen.

> [!TIP]
>
> A bare `${name}` in a row label reads the root, which usually shows nothing and raises no error. When a row shows empty values, check for missing `item:` prefixes first.

Other placement messages:

* `"item:name" only works inside a collection or table row.`: an `item:` or `parent:` key on a component that isn't in a row.
* `"parent:x" has no enclosing collection. Use "item:" for this row.`: a `parent:` key in a collection that isn't nested.
* `"parent:" cannot be used in this field. Use "item:" for a field of this row.`: single-key fields (a data key, a source) never take `parent:`.
* `Add a field name after "item:", for example "item:name".`: an empty `item:`.

***

## Tables

A table cell's keys follow the same rules: `item:` reads the row, a bare key reads the root.

* **Sorting and filtering** use the cell's first `item:` key, or its first key when it has none.
* **Editable cells** edit their first key only when that key is an `item:` key. A cell whose first key is a bare root key is read-only in the row.

***

## Nested collections

A collection inside a collection item reads its list from the outer row when its source is an `item:` key, for example `item:addresses`. Inside the inner rows:

* `item:street` reads the inner row (the address).
* `parent:name` reads the outer row (the customer the address belongs to).
* `country` reads the data root.

A nested collection whose source is a bare key, for example `countries`, reads a root list and starts its rows fresh: its rows have no `parent:`.

`parent:` reaches one level up only. In expressions you can use it to read the outer row; single-key fields such as a data key never take it. In a table placed inside a collection item, `parent:` in a cell reads the collection row.

***

## Write row action results back into the row

In a UI flow, an action fired from a row can write its result into that row instead of the data root. Three settings work together.

### Row identifier key

Set on the **Collection** or **Table** in a UI flow, under its source. Pick a field whose value is unique in every row and never changes, such as `id`. When a workflow or upload result comes back, FlowX finds the row by this value, so the result lands in the right row even if the list was re-sorted or reloaded in the meantime.

* The field must be text or a number: the Designer shows `The Row identifier key must be a text or number field` for objects, lists and booleans.
* A sensitive field can't be used, because its value is sent with every row action request.
* If two rows share a value, the result goes to the first of them in the list.
* Process screens don't show this setting. Only UI flow row actions read it.

### Output destination and Write result to

Actions inside a row of a UI flow or reusable template get a setting that chooses **Current row** or **Root**:

| Action | Setting label | Default | What Current row does |
| - | - | - | - |
| **Start workflow** | **Output destination** | Root | Merges the workflow's result object into the row |
| **Upload** (collection rows only) | **Output destination** | Root, but a new upload starts on Current row when every enclosing collection has a Row identifier key and the upload isn't in a reusable template | Stores the upload response under the **Response key** inside the row |
| **Run local script** | **Write result to** | Current row | Merges the object the script returns into the row |

Merging follows the usual rules: nested objects merge field by field, while lists and other values replace what the row held.

* **Start workflow** and **Upload** find the row by its **Row identifier key**. If a level of the row has no key, the setting shows `<Collection or Table name> has no Row identifier key.` with a **Set it** button that opens that collection or table. The action can't be saved with **Current row** until that key is set.
* **Run local script** runs on the client against the row it was fired from, so it needs no Row identifier key.
* An upload in a table row keeps its plain **Response key** and has no destination choice.
* For an upload with Current row, write the **Response key** without `item:` or `parent:`. It can't name the Row identifier key field, which would overwrite the identifier.

The workflow returns the row's fields directly, for example `{ "status": "done" }`, not wrapped in the row's path. Wrap them only if you want a sub-object in the row.

Edge cases:

* If no row matches when the result arrives (the row was removed, or its identifier changed), the result is dropped and a warning is logged. Nothing is written to the root instead.
* If the row's identifier is empty (missing, `null` or `""`), the request is refused, the action counts as failed and the rest of the action chain doesn't run. `0` is a valid identifier.
* The next actions of a row wait only for that row's own run, so users can keep working in other rows.
* A **Save local variable** copy of the row (**Row item save key**) stays a root key. When a Current row result lands, the copy is refreshed only if it still holds the same row.
* Actions saved before these settings existed are not changed and behave as before.

### Example: refresh one row from a workflow

A table lists orders from `orders`, each with an `id`. Each row has a **Refresh** button that calls a workflow returning `{ "status": "SHIPPED", "tracking": { "number": "1Z999" } }`.

**1. Set the Row identifier key**

Select the **Table** and set **Row identifier key** to `id`.

**2. Add the row action**

On the **Refresh** button, add a **Start workflow** action with the workflow, and pass the row's id in its start params with `${item:id}`.

**3. Write the result to the row**

Set **Output destination** to **Current row**.

When the workflow finishes, the matching order row gets `status` and `tracking.number`. The other rows and the data root stay as they were.

***

## Reusable templates and rows

Inside a reusable UI template, keys belong to the template: a bare key reads the template's own data root, and `item:` reads rows of a collection or table inside the template, never the rows of the screen that hosts it. Actions inside a template's own rows can still choose **Current row** for **Write result to** and **Output destination**.

Two cases need attention:

* **A reusable template placed in a collection item or table row** can map only root values through its input and output mapping. Where it used to show the item's value, it now shows the root value or nothing, with no error.
* **Action params set on a reusable template reference**, when the host component is outside any row but the action sits in a collection inside the template: a bare `${amount}` in those params now reads the root. Change it by hand to `${item:amount}`.

***

## Upgrading and importing

When a self-hosted installation upgrades to the next LTS release, a process engine migration rewrites the keys stored in every process screen, UI flow and reusable template, every version and deleted ones included. Keys inside collection items and table rows that used the old relative form become `item:` keys, for example `name` becomes `item:name`. The migration is restartable.

Imports go through the same rewrite, so a process, UI flow or reusable template exported from an earlier version opens with `item:` keys.

The migration leaves these as written:

* A value that isn't a plain key (for example a key built from text and expressions). It's logged instead.
* Navigation query parameters.
* An empty `item:`.
* Keys a custom component builds at runtime in its own code, and data paths a script builds as strings. The migration can't see them.

After the upgrade, open the **Issues Console** for each project and fix the findings listed in [Issues Console rules](#issues-console-rules). Then check custom components and scripts that compose row keys themselves.

### Exporting to an earlier version

An export that targets an earlier FlowX version (for example 5.9.x) converts back: `item:` keys become the old relative keys, and the **Row identifier key** and **Current row** destinations are removed, because earlier versions don't have them. `parent:` keys are not converted, so check the screens that use them after you import the export into the earlier version.

***

## Issues Console rules

These rules report misplaced row keys and row settings. All of them are errors.

| Rule | Reported when | Checked on |
| - | - | - |
| **Item key outside an item** | An `item:` or `parent:` key sits on a component outside a collection item or table row, for example after it was moved, pasted or imported | Process screens, UI flows, reusable templates |
| **Item input field without an item: key** | A form field inside a row has a bare key, so every row would share one value at the root | Process screens, UI flows, reusable templates |
| **Row identifier key missing** | An action writes to Current row but a collection or table around it has no Row identifier key | UI flows, reusable templates |
| **Row identifier key edited in the row** | A form field in the row edits the field used as the Row identifier key | UI flows, reusable templates |
| **Row identifier key not text or number** | The Row identifier key points at an object, a list or a non-text, non-number field | UI flows, reusable templates |
| **Row setting outside a row** | An action set to Current row is no longer inside a row, for example after it was moved | UI flows, reusable templates |

For how findings are listed and fixed, see [Checking for issues](https://docs.flowx.ai/6.x/docs/projects/managing-applications/checking-for-issues.md).

***

## Related resources

> [card] [Collection](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/ui-component-types/collection/collection.md)
>
> Display lists of items from your data

> [card] [Collection prototype](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/ui-component-types/collection/collection-prototype.md)
>
> Lay out each item of a collection

> [card] [Table](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/ui-component-types/table.md)
>
> Show rows with sorting, filtering and row actions

> [card] [Event handlers](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/event-handlers.md)
>
> Configure actions and where their results go


## Related topics

- [Collection](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/ui-component-types/collection/collection.md)
- [Table](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/ui-component-types/table.md)
- [Reusable UI Templates](https://docs.flowx.ai/6.x/docs/building-blocks/reusable-resources/reusable-ui.md)
- [Collection Prototype](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/ui-component-types/collection/collection-prototype.md)
- [Event Handlers](https://docs.flowx.ai/6.x/docs/building-blocks/ui-designer/event-handlers.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.