Handlebars repeat
Handlebars repeat: repeats a block a specified number of times, exposing index, first, and last loop variables.
Next
Runtime verified
Test scripts included
Repeats a block a specified number of times, exposing index, first, and last loop variables.
Syntax
{{#repeat count}}
…
{{/repeat}}
Returns string.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
count |
integer | Yes | How many times to render the block. Must be a non-negative integer. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{#repeat 3}}x{{/repeat}}rendersxxx, as documented.{{#repeat 3}}{{index}}{{/repeat}}renders012, as documented.{{#repeat 0}}x{{/repeat}}renders an empty string, as documented.
Show Next test script
Marketing Cloud Next
Works as documented
Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.