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

# template-name

Declares that the worksheet can be **rendered from** a template worksheet named `<name>` in the user's workbook — or, on an output worksheet, **filled into** that template worksheet.

`pebblestream:template-name:<name>`

This directive is **mandatory**: any worksheet that uses another template directive
(extraction or `template-out-*`) must also declare a `template-name`, otherwise
compilation fails with `missing-the-template-name-directive`.

## Syntax

```
pebblestream:template-name:Template
pebblestream:template-name:"Q3 Report"
```

* Takes **exactly one** argument: the name of the template worksheet.
* Quote the name if it contains spaces.
* Placed on any cell of the worksheet (typically the header row, like other
  sheet-level directives).

## How it is used

* **Input worksheets** — when the user clicks *extract* or *submit* in the Zen
  taskpane, Zen locates the worksheet with this name in the user's workbook and
  extracts records from it into this worksheet's flat table. See
  [Template directives](template-directives.md#extraction-flow).
* **Output worksheets** — after a run, *generate data* writes this worksheet's
  results back into the template worksheet, using the
  [template-out directives](template-directives.md#output-fill-directives).
* Several worksheets may share one template name: they are all rendered from (or
  filled into) the same template worksheet.

## Example

A pebble with an input sheet `Sales` extracted from the user's `Template` sheet:

| cell | comment                               |
| ---- | ------------------------------------- |
| `A1` | `pebblestream:template-name:Template` |
| `B1` | `pebblestream:block-id`               |

## Errors

| Error                                 | Cause                                                                                          |
| ------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `dir-wrong-number-of-args`            | Not exactly one argument, or a blank name.                                                     |
| `missing-the-template-name-directive` | Reported on the *sheet* when other template directives are present but `template-name` is not. |

## Related

* [Template directives](template-directives.md) — overview of the whole family
* [block-id](block-id.md), [template-row](template-row.md), [template-column](template-column.md) — per-record metadata
* [template-out-header](template-out-header.md) — output fill anchors