2022.1

Table Of Contents
Handlebars expressions
Note
The information in this Online Help focuses on the implementation of Handlebars in OL
Connect. For general information about Handlebars and how to use it, see the following
web sites: https://handlebarsjs.com/ and https://devdocs.io/handlebars.
Data in expressions
A handlebars expression is a {{, some contents, followed by a }}.
For example:
<p>Hello {{firstname}} {{lastname}}!</p>
In its most simple form the contents of the expression refer to a data field. They will be replaced
with the value of that field if it exists in the data that is passed to the template (see "Render the
Handlebars template" on page783).
You can simply write the field or key name in the expression. A whitespace before and after the
field or key name is accepted, e.g. {{fullName }}.
Another, quick way to insert a simple expression is to drag and drop the field from the Data
Model in the Handlebars template.
When you drag and drop a field into a Handlebars template, a call to a function that formats the
value may be added automatically. This depends on the field type.
For example, dragging a currency field will produce: {{currency fieldName}} which outputs a
number formatted as an amount of money.
You can remove the function or change it (see "Formatting values" on page981).
When a data field of the type HTML String is dragged into a Handlebars snippet, the
expression gets three curly brackets to ensure that HTML characters are not escaped (see
"HTML values" on page981).
It is possible to use logic in an expression, for example to display content only if a field has a
certain value. How this is done is described in another topic: "Using logic in a Handlebars
template: helpers" on page982.
Page 979