---
updatedAt: 2026-10-15T14:14:19.000Z
agentTools:
  projectIndex: https://docs.pebblestream.com/llms.txt
---

# template-row

Marks a column that receives the **row index (line number) of the record inside the template worksheet** — the row the values were extracted from.  Useful when results must later be written back to the same place in the template, or when the row position itself carries meaning (e.g. a period or scenario laid out row by row).

`pebblestream:template-row`

## Syntax

```
pebblestream:template-row
```

* No arguments.
* Placed on the **header cell of the column** that should hold the row index.
* Requires [`template-name`](template-name.md) on the same worksheet.

## Example

| column | header       | comment                     |
| ------ | ------------ | --------------------------- |
| A      | `Source row` | `pebblestream:template-row` |
| B      | `Item`       |                             |
| C      | `Qty`        |                             |

A record extracted from row 17 of the template worksheet gets `17` in the
`Source row` column.

## Errors

| Error                                 | Cause                             |
| ------------------------------------- | --------------------------------- |
| `dir-too-many-args`                   | Arguments were supplied.          |
| `missing-the-template-name-directive` | The sheet has no `template-name`. |

## Related

* [Template directives](template-directives.md) — how extraction works
* [template-column](template-column.md) — the column-index counterpart (for column-oriented templates)
* [block-id](block-id.md) — which block the record came from