> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.lido.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Tables: how columns work

A Lido table is a named, structured dataset inside your spreadsheet. Every column has a specific role — computed, linked, plain, or sourced from external data — and that role determines how values get into the cells. This article explains each column type and when to use it.

---

## Why tables matter

A regular spreadsheet range is just cells. A Lido table is a *named* dataset whose columns have *behavior*. Tables let you:

- Reference data by name (`Orders[@Price]`) instead of by cell address.
- Pull rows from external sources that refresh automatically.
- Combine computed fields, manually-edited fields, and source-fed fields in the same dataset.
- Apply transformations (filter, sort, group) without breaking downstream formulas.

---

## The four column types

| Column type | What it does | When to use |
| --- | --- | --- |
| **Source** | Values come from an external source (CRM, database, API, file). Refresh automatically. | The data lives somewhere else and you want it kept in sync. |
| **Computed** | A formula runs once per row and produces the value. Same formula for every row. | Calculated fields like Total = Price × Quantity. |
| **Linked** | Each row stores its own independent value, keyed by an ID column. Different formula or value per row. | Per-row notes, manual overrides, row-specific logic. |
| **Plain** | Empty column for manual data entry. No formula. | Status fields, comments, anything you'll type by hand. |

A single table can mix all four. A Products table might pull rows from a CRM (source), calculate Revenue (computed), have an Override Price (linked), and a Notes column (plain).

---

## Computed columns

A computed column applies the same formula to every row. Type a formula in a cell immediately to the right of the table and Lido turns it into a computed column.

```
=Orders[@Price] * Orders[@Quantity]
```

Lido evaluates this for every row, resolving `[@Price]` and `[@Quantity]` to the values in that row.

You can also use template strings for simple text construction:

```
{First Name} {Last Name}
```

**Restriction:** the formula inside a computed column cannot create another column. Don't nest `COMPUTEDCOLUMN`, `LINKEDCOLUMN`, `MAKETABLE`, `RANGETABLE`, or `PLAINCOLUMN` inside a computed column.

Under the hood, Lido stores it as: `=COMPUTEDCOLUMN(formula, table_name, column_name)`.

---

## Linked columns

A linked column stores a separate value or formula for each row, keyed by an ID column. Use it when:

- Some rows have manual overrides and others use a default formula.
- Each row needs row-specific behavior (different notes, different rules).
- You want manual edits to follow the row even when the table is filtered or sorted.

The ID column must have unique values. Duplicates cause an error.

If a row's ID changes, its linked value follows the new ID — meaning you can rename a record without losing its custom data.

Under the hood: `=LINKEDCOLUMN(table_name, id_column_name, column_name, lc_id)`. Lido auto-generates the `lc_id`.

---

## Plain columns

The simplest column type. No formula. Users type values directly. Use plain columns for:

- Status fields ("Approved", "Rejected", "Pending")
- Notes and comments
- Manually-entered fields that don't have a calculation behind them

Under the hood: `=PLAINCOLUMN(table_name, column_name)`.

---

## Source columns

A source column's values come from an external source — a CRM, database, generic API, file, or other connection. Lido refreshes the values on a schedule (or manually, on demand).

Source columns are created when you set up an external data source via **File → Connect real-time data**. You don't add source columns one at a time; the connection wizard creates the table and columns together.

See: **Connect a real-time data source** for setup.

---

## Adding columns to an existing table

To add a new column, start typing in any empty cell immediately to the right of the table. Lido detects you're extending the table and prompts you to pick the column type:

- Type a formula → computed column
- Type a value → plain column
- Lido may suggest a linked column if the table has a unique ID column and the value looks per-row

You can rename, reorder, and delete columns from the column header menu.

---

## Referencing tables in formulas

Three syntaxes:

| Syntax | Returns | Example |
| --- | --- | --- |
| `TableName[@ColumnName]` | The value in that column **for the current row** | `Orders[@Price]` |
| `TableName[ColumnName]` | The **entire column** as an array | `SUM(Orders[Revenue])` |
| `TableName[#All]` | The **entire table** (all columns, all rows) | `FILTER(Orders[#All], Orders[@Status]="Pending")` |

The `@` prefix is the most common — it's used inside computed columns and in formulas next to a table.

---

## Worked example: an orders table

Build a table named `Orders` from a CSV import. Then add columns:

- `Subtotal` — computed: `=Orders[@Price] * Orders[@Quantity]`
- `Tax` — computed: `=Orders[@Subtotal] * Orders[@Tax Rate]`
- `Total` — computed: `=Orders[@Subtotal] + Orders[@Tax]`
- `Status` — plain (typed manually)
- `Customer Notes` — linked (different per row, follows the Order ID)

Now reference the table elsewhere:

```
=SUM(Orders[Total])
=COUNTIF(Orders[Status], "Shipped")
=FILTER(Orders[#All], Orders[@Status]="Pending")
```

---

## Common mistakes

- **Adding a computed column with a formula that creates another column.** Don't nest `COMPUTEDCOLUMN`, `LINKEDCOLUMN`, etc. inside a computed column. The result is unpredictable.
- **Using a non-unique ID column with linked columns.** Each ID must be unique or Lido raises an error.
- **Editing source column values manually.** They'll be overwritten on the next refresh. Use a separate plain or linked column for manual notes.
- **Mixing up `[@Column]` and `[Column]`.** `[@Column]` returns one value (current row); `[Column]` returns an array (the whole column).

---

## Related articles

- Concepts: spreadsheet vs. workflow vs. API
- Actions: how spreadsheet automation works
- AI columns and formulas
- Expressions and the formula bar
- Connect a real-time data source