2022.2

Table Of Contents
Note: IfaHandlebarstemplateisrenderedwithpartofthecurrentrecord,thetemplatestill
hasaccesstotheentirerecordandcannavigateupandoutsideofthatpart,toahigher
levelinthecurrentrecord.
IfaJavaScriptobjectispassed,thetemplateonlyhasaccesstothepasseddata,andit
doesnothaveaccesstothecurrentrecord.
Formattingvalues
FunctionsthatcanbeusedinaHandlebarsexpressionarecalled"Helpers".OLConnectprovidesa
numberofHelperstoformat the valuethatistheresultofanexpression.Forexample:{{upperCase
FirstName}}returnsthevalueoftheFirstNamedatafieldinuppercase.
Theavailablefunctionsarelistedinthetopic:"FormatHelpers"onpage769.
HTMLvalues
ThevaluereturnedbyanexpressionisHTML-escaped.Thismeansthatcharactersthathaveaspecial
functioninHTML:& < > \" ' ` =arereplacedwithHTMLcharacterreferences.Forexample:&willbe
changedinto&amp;.
Takethisexpression:<span>{{foo}}</span>.
Ifthefieldfoocontainsa'>'andyoudon'tHTML-escapeit,thiswouldproduceinvalidHTML:
<span>...>...</span>.
AfterHTML-escaping,itbecomesvalidHTML:<span>&gt;</span>.
IftheresultofanexpressionshouldnotbeHTML-escaped,theexpressionmustbeenclosedinthree
curlybrackets:{{{...}}}.CharacterswithaspecialfunctioninHTMLwillthenbeinterpretedasHTML.
Forexample,thevalue"<b>Name</b>"willbedisplayedasName.
WhenanHTMLfieldisdraggedintoaHandlebarstemplateitisautomaticallyenclosedinthreecurly
brackets.
Note: Contentprovidedby'blockhelpers'-expressionsintheform{{#helperNameargu-
ments}}...{{/helperName}}-isnotautomaticallyHTML-escaped.See"Usingfunctionsinexpres-
sions:Helpers"onthefacingpage.
Testingexpressions
Totestwhetherexpressionsgivetheexpectedresult,simplyswitchtoPreviewmodeintheWork-
space.YoucouldalsodoaPreflighttotestwithmultiplerecords(see"DoingaPreflight"onpage818).
Logging
ValuescanbeloggedwithanexpressionthatusesthelogHelper.ForexamplesseeHandlebars'doc-
umentation.
Page 765