---
schema_version: "1"
id: 71a43340df4b2ee63323680c948b38e6a821df704a7e4226a0e8a3d576401832
title: "Handlebars Helper Function: repeat"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/utility/mcn-handlebars-reference-utility-repeat.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-utility-references/mcn-handlebars-reference-utility-repeat.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: b787e19a3aeac67c5fed2f536a92fe1eff5f6cd98927d1bdec310525ef7e6283
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: repeat

Repeats a block of template code a specified number of times, providing loop context variables for each iteration.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{#repeat count}}
  Block content
{{/repeat}}
```

## Parameters

| Parameter | Type              | Description                                                                                |
| --------- | ----------------- | ------------------------------------------------------------------------------------------ |
| `count`   | Integer or String | Required. Number of times to repeat. Must be convertible to a non-negative integer (>= 0). |

## Return Value

The function repeats the block `count` times and returns the concatenated result.

Each iteration provides these loop variables:

- `index`: A 0-based index of the current iteration.
- `first`: A boolean indicating whether the current iteration is the first iteration.
- `last`: A boolean indicating whether the current iteration is the last iteration.
- All parent context variables.

If `count` is `0`, the function returns an empty string. If the parameter is invalid, the function throws an exception.
