Skip to content

Handlebars helper reference

Every Restorm expression is a Handlebars template: URL, header, parameter, request body, Expression-typed environment variable, scenario field, the Transform template action’s template.

This page lists 116 named helpers and 22 dynamic variables.

Ctrl+Space triggers autocompletion in the fields that support it.

HelperSignatureEffect
eq{{eq a b}}a === b
ne{{ne a b}}a !== b
neq{{neq a b}}Alias of ne
lt{{lt a b}}a < b (numeric)
lte{{lte a b}}a <= b
gt{{gt a b}}a > b
gte{{gte a b}}a >= b
and{{#and a b}}…{{else}}…{{/and}}Block: every argument truthy
or{{#or a b}}…{{/or}}Block: at least one argument truthy
not{{not value}}Negation
ifEquals{{#ifEquals a b}}…{{else}}…{{/ifEquals}}Block, strict equality
is{{#is a b}}…{{/is}}Block, comparison as strings
isnt{{#isnt a b}}…{{/isnt}}Block, difference as strings
default{{default value fallback}}value if defined, otherwise fallback
compare{{#compare a "op" b}}…{{/compare}}Block; op== === != !== < <= > >=
{{default region "eu-west-1"}}
{{#compare quantite ">" 100}}gros{{else}}normal{{/compare}}
HelperSignatureExample → result
lowercase{{lowercase s}}Hellohello
uppercase{{uppercase s}}HelloHELLO
capitalize{{capitalize s}}hello thereHello there
capitalizeAll{{capitalizeAll s}}hello thereHello There
titleize{{titleize s}}Identical to capitalizeAll
camelcase{{camelcase s}}my-fieldmyField
pascalcase{{pascalcase s}}my-fieldMyField
snakecase{{snakecase s}}myFieldmy_field
snakeCase{{snakeCase s}}Alias of snakecase
dashcase{{dashcase s}}myFieldmy-field
dotcase{{dotcase s}}myFieldmy.field
pathcase{{pathcase s}}myFieldmy/field
sentencecase{{sentencecase s}}HELLO THEREHello there
slugify{{slugify s}}My Fine Title!my-fine-title
trim{{trim s}}Strips whitespace from both ends
trimLeft{{trimLeft s}}From the left
trimRight{{trimRight s}}From the right
replace{{replace s search replacement}}Replaces every occurrence (literal, no regex)
split{{split s separator}}Splits into an array; separator , by default
truncate{{truncate s length suffix}}Length 50 and suffix ... by default
ellipsis{{ellipsis s length}}Like truncate with
append{{append s suffix}}Concatenates at the end
prepend{{prepend s prefix}}Concatenates at the start
reverse{{reverse value}}Reverses a string or an array
startsWith{{#startsWith s prefix}}…{{/startsWith}}Block
endsWith{{#endsWith s suffix}}…{{/endsWith}}Block
contains{{#contains stringOrArray value}}…{{/contains}}Block
match{{match s pattern}}Every match, or null
test{{#test s pattern}}…{{/test}}Block, regular expression test
padStart{{padStart s length character}}Pads on the left
padEnd{{padEnd s length character}}Pads on the right
repeat{{repeat s n}}Repeats
substring{{substring s start end}}Extracts
indexOf{{indexOf s search}}Position, or -1
count{{count s substring}}Number of occurrences
newLineToBr{{newLineToBr s}}\n<br>
stripTags{{stripTags s}}Strips <…> tags
{{slugify nomProduit}}
{{padStart numeroCommande 8 "0"}}
{{truncate description 120}}
HelperSignatureEffect
add{{add a b}}Sum
subtract{{subtract a b}}Difference
multiply{{multiply a b}}Product
divide{{divide a b}}Quotient
modulo{{modulo a b}}Remainder
abs{{abs a}}Absolute value
ceil{{ceil a}}Rounded up
floor{{floor a}}Rounded down
round{{round a}}Rounded
pow{{pow base exponent}}Power
sqrt{{sqrt a}}Square root
random{{random min max}}Random integer, bounds included
sum{{sum array}}Sum of an array
avg{{avg array}}Average
min{{min a b c …}}Minimum, variadic
max{{max a b c …}}Maximum, variadic
toFixed{{toFixed number decimals}}A string with N decimal places
toInt{{toInt number}}Integer (base 10), 0 as a fallback
toFloat{{toFloat number}}Float, 0 as a fallback
{"montantTTC": {{toFixed (multiply montantHT 1.2) 2}}}
HelperSignatureEffect
first{{first array n}}The first element, or the first n
last{{last array n}}The last, or the last n
length{{length value}}The length of an array or a string, or a number of keys
join{{join array separator}}Separator , by default
sort{{sort array}}A sorted copy
unique{{unique array}}De-duplicates
after{{after array n}}Everything after index n
before{{before array n}}Everything before index n
slice{{slice array start end}}A portion
concat{{concat a b …}}Concatenates, flattening one level
flatten{{flatten array}}Flattens one level
pluck{{pluck array property}}Extracts one property from every element
itemAt{{itemAt array index}}The element at that index; a negative index counts from the end
inArray{{#inArray array value}}…{{/inArray}}Block
isArray{{isArray value}}Boolean
isEmpty{{#isEmpty value}}…{{/isEmpty}}Block
some{{#some array prop value}}…{{/some}}Block: at least one element matches
every{{#every array prop value}}…{{/every}}Block: every element matches
{{join (pluck articles "reference") ","}}
HelperSignatureEffect
JSONstringify{{JSONstringify obj}}Serialises, indent 2
JSONparse{{JSONparse string}}Parses; {} on failure
get{{get obj "a.b.c"}}Reads by dotted path
isObject{{isObject value}}Boolean (non-null, non-array)
typeOf{{typeOf value}}null, array, or the JavaScript type
keys{{keys obj}}The keys
values{{values obj}}The values
entries{{entries obj}}The [key, value] pairs
hasOwn{{#hasOwn obj "key"}}…{{/hasOwn}}Block
pick{{pick obj "k1" "k2"}}Keeps only those keys
omit{{omit obj "k1"}}Removes those keys
merge{{merge o1 o2}}Shallow merge
{{get reponse "data.client.identifiant"}}
HelperSignatureEffect
encodeURI{{encodeURI s}}Encodes a URL component
decodeURI{{decodeURI s}}Decodes
urlParse{{urlParse url}}{ href, origin, protocol, host, hostname, port, pathname, search, hash }, or null
stripQuerystring{{stripQuerystring url}}Strips the query string
stripProtocol{{stripProtocol url}}Strips the scheme
{{baseUrl}}/recherche?q={{encodeURI termeRecherche}}
HelperSignatureEffect
year{{year}}The current year
now{{now}}The current moment, in ISO form
timestamp{{timestamp}}The current moment, in milliseconds
formatDate{{formatDate date "YYYY-MM-DD"}}Formats

Note too that {{timestamp}} is in milliseconds whereas {{$timestamp}} (Postman compatibility, below) is in seconds.

HelperSignatureEffect
coalesce{{coalesce a b c}}The first non-null value
uuid{{uuid}}A UUID v4
noop{{#noop}}…{{/noop}}A block with no effect
raw{{{{raw}}}}…{{{{/raw}}}}Does not interpret the content
times{{#times n}}…{{/times}}Repeats the block; @index, @first, @last available
range{{range start end step}}An array of numbers, end excluded

The raw helper is what you need when you are sending double braces deliberately — for instance to test a service that interprets them itself.

Dynamic variables (Postman compatibility) (22)

Section titled “Dynamic variables (Postman compatibility) (22)”

Argument-less, with a different value on every evaluation.

VariableReturns
{{$guid}}A UUID v4
{{$randomUUID}}A UUID v4
{{$timestamp}}The current moment, in seconds
{{$isoTimestamp}}The current moment, in ISO form
{{$randomInt}}An integer from 0 to 1000
{{$randomAlphaNumeric}}8 alphanumeric characters
{{$randomBoolean}}true or false
{{$randomFirstName}}A first name
{{$randomLastName}}A surname
{{$randomFullName}}A full name
{{$randomUserName}}firstname.surname<0-99>
{{$randomEmail}}An email address
{{$randomColor}}A colour name
{{$randomWord}}A word
{{$randomWords}}Three words
{{$randomCompanyName}}A company name
{{$randomCity}}A city
{{$randomCountry}}A country
{{$randomPhoneNumber}}A phone number
{{$randomIP}}An IP address
{{$randomIPV4}}An IPv4 address
{{$randomPrice}}A price with two decimal places
{
"correlationId": "{{$guid}}",
"client": { "nom": "{{$randomFullName}}", "email": "{{$randomEmail}}" },
"emisLe": "{{$isoTimestamp}}"
}

There is no variable-access helper: variables are directly in the context. You write {{baseUrl}}, not {{env "baseUrl"}}.

See Variables and environments.