> ## 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).

# Expressions and the formula bar

Most parameters in Lido — both spreadsheet formulas and workflow node parameters — accept either a literal value or an expression. Expressions let you reference other cells, other items, today's date, computed values, and more.

---

## Two places expressions appear

| Surface | Syntax | Example |
| --- | --- | --- |
| **Spreadsheet formulas** | Cell references and table references | `=Orders[@Price] * Orders[@Quantity]` |
| **Workflow node parameters** | `{{...}}` template syntax | `{{$item.data.fieldName}}` |

The mental model is the same — pull a value from somewhere else and use it here. The syntax differs because spreadsheets use formula language and workflow parameters use templating.

---

## Spreadsheet formulas

Standard spreadsheet operations work as expected: `+`, `-`, `*`, `/`, `=`, references like `A1`, `$A$1`, ranges like `A1:A10`, named ranges, and a wide function library (`SUM`, `IF`, `VLOOKUP`, `FILTER`, etc.).

Lido adds:

**Table references** — `TableName[@Column]` (current row), `TableName[Column]` (whole column), `TableName[#All]` (entire table). See **Tables: how columns work**.

**Lido-specific formulas** — categories include AI (`GPT`, `CLAUDE`), Messaging (`SENDGMAIL`, `SENDSLACK`), Documents (`CREATEPDF`, `EXTRACTTEXT`), Date/time, Files, Scripting, and more. See the Lido docs Spreadsheet → Formulas reference for the full list.

**Action formulas** — formulas that return an Action value compile into executable operations rather than display values. See **Actions: how spreadsheet automation works**.

**Named cells, local-only cells, custom lambdas** — see Spreadsheet → Concepts in the docs.

---

## Workflow expressions

Inside any workflow node parameter, wrap an expression in `{{...}}`:

```
{{$item.data.fieldName}}
```

This reads the value of `fieldName` from the current item flowing through the workflow.

### The `$item` object

Each node processes items one at a time. `$item.data` is the current item's payload — the JSON object emitted by the previous node. Common patterns:

```
{{$item.data.fileUrl}}          // a top-level field
{{$item.data.invoice.total}}    // a nested field
{{$item.data.lineItems[0].sku}} // an array element
```

### JavaScript methods

Expressions support standard JavaScript methods on strings, numbers, and arrays:

```
{{$item.data.name.toUpperCase()}}
{{$item.data.email.toLowerCase()}}
{{$item.data.amount.toFixed(2)}}
{{$item.data.tags.join(", ")}}
```

### Arithmetic

```
{{$item.data.price * $item.data.quantity}}
{{$item.data.subtotal * 1.08}}
{{($item.data.high + $item.data.low) / 2}}
```

### Reference another node by name

```
{{$("Get Table").item.data.recordId}}
{{$("Data Extractor").item.data.Vendor Name}}
```

Useful when a downstream node needs data from earlier in the workflow, not just the immediate previous step.

---

## Date and time

Lido provides dedicated date helpers in workflow expressions:

```
{{$today()}}                          // today's date
{{$now()}}                            // current timestamp
{{$today().plus(7, "day")}}           // a week from today
{{$today().minus(1, "month")}}        // last month
{{$now().startOf("day")}}             // midnight today
{{$now().endOf("week")}}              // end of this week
{{$today().format("YYYY-MM-DD")}}     // formatted string
{{$today().diff($item.data.dueDate, "day")}}  // difference in days
```

Available unit names: `year`, `month`, `week`, `day`, `hour`, `minute`, `second`.

Available format helpers on a `LidoDateTime`: `.plus()`, `.minus()`, `.startOf()`, `.endOf()`, `.format()`, `.diff()`, `.toISODate()`, `.toISODateTime()`.

---

## Toggling literal vs. expression

Most parameter inputs in Lido have a mode switch. **Literal mode** treats your input as plain text. **Expression mode** evaluates `{{...}}` expressions and JavaScript.

If your input contains `{{` or `}}` literally (for example, in a templated email body), make sure the parameter is in expression mode and escape with the appropriate quoting, OR keep it in literal mode and use a different placeholder syntax.

---

## Worked examples

### Email subject with extracted data

In a Send Gmail node's Subject parameter:

```
Invoice {{$item.data.Invoice Number}} from {{$item.data.Vendor Name}}
```

### Slack message with formatted total

In a Send Slack node's Message parameter:

```
New invoice: ${{$item.data.Total Amount.toFixed(2)}} due {{$item.data.Due Date}}
```

### Conditional with the `If` node

In an If node's Condition parameter:

```
{{$item.data.Total Amount > 10000}}
```

Items where this is true take the true branch; others take the false branch.

### Calculate due-date for an SLA

```
{{$today().plus(30, "day").toISODate()}}
```

Use this in an Insert Rows node to write today + 30 days into a Due Date column.

---

## Tips

- **Hover the parameter input** to see Lido's available expression suggestions for that node.
- **Test expressions one at a time.** Build complex expressions step by step using a temporary debug node (Edit Item) so you can see intermediate values.
- **Use named references (`$("Node Name")`)** for clarity in long workflows.
- **Format dates explicitly** with `.format("YYYY-MM-DD")` when writing to spreadsheets — leaving it as a raw `LidoDateTime` may not render the way you expect.

---

## Common mistakes

- **Forgetting the `{{` and `}}`.** Without them, the parameter treats your input as a literal string.
- **Using cell-reference syntax (`A1`) inside workflow expressions.** Workflow expressions don't see cells — they see items. Use `$item.data.fieldName` or `$("Node Name").item.data...`.
- **Trying to use `$today()` in a spreadsheet formula.** `$today()` is workflow syntax. In the spreadsheet, use `TODAY()` (uppercase).
- **Calling JavaScript methods on `null` or `undefined`.** If the upstream field might be missing, default it: `{{($item.data.name || "").toLowerCase()}}`.
- **Confusing `$item` (workflow) with `[@Column]` (spreadsheet table).** They're for different contexts.

---

## Related articles

- Tables: how columns work
- Actions: how spreadsheet automation works
- Build your first workflow
- AI columns and formulas
- Nodes reference (overview)