---
updatedAt: 2026-10-15T13:56:28.000Z
agentTools:
  projectIndex: https://docs.pebblestream.com/llms.txt
---

# template-column

Marks a column that receives the **column index of the record inside the template worksheet** — the column the values were extracted from.

`pebblestream:template-column`

This is the counterpart of [`template-row`](template-row.md) for
[column-oriented](column-oriented-headers.md) templates, where each record is a
*column* of the template rather than a row.

## Syntax

```
pebblestream:template-column
```

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

## Example

| column | header          | comment                                 |
| ------ | --------------- | --------------------------------------- |
| A      | `Source column` | `pebblestream:template-column`          |
| B      | `Item`          | `pebblestream:template-name:"Partners"` |
| C      | `Qty`           |                                         |

A record extracted from column `D` of the template worksheet gets its column index
in the `Source column` 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-row](template-row.md) — the row-index counterpart
* [column-oriented-headers](column-oriented-headers.md) — orientation hint