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

# block-row-count

Marks a column that receives a **constant**: the number of data rows in the record's _block_ inside the template worksheet.

`pebblestream:block-row-count`

Useful when the pebble needs to reason about the size of the table each record<br />came from — for example, to divide a block total across its rows, or to know how<br />many rows to write back when filling the template.

## Syntax

```
pebblestream:block-row-count
```

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

## Example

| column | header          | comment                                  |
| ------ | --------------- | ---------------------------------------- |
| A      | `Rows in block` | `pebblestream:block-row-count`           |
| B      | `Item`          | `pebbblestream:template-name:"Partners"` |
| C      | `Qty`           |                                          |

Every record extracted from a block with 12 data rows gets `12` in the
`Rows in block` 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
* [top-row](top-row.md), [bottom-row](bottom-row.md) — the block's vertical bounds
* [block-id](block-id.md) — which block the record came from