Handlebar Helper Function: Random
Generates a random integer between two specified values. The function can handle both integers and floating-point numbers.
This helper is available in the Winter ’26 release of Marketing Cloud Next (API version 65.0).
| Parameter | Type | Description |
|---|---|---|
first | Number or String | Required. The minimum value. Must be a number or convertible to a number. |
second | Number or String | Required. The maximum value. Must be a number or convertible to a number, and must be greater than or equal to first. |
The function returns a random integer that is greater than or equal to first and less than or equal to second. If you provide more than two arguments, the operation uses only the first two.
The function throws an exception if the second parameter is less than the first, or if either input is a string that can’t be converted to a number.