2022.2

Table Of Contents
6. Addasmanydatafieldsasyouneed,followingthesameprocedure.
7. Optionally,youcanclickOptionsatthebottomtospecifyhowtheresultisinserted:
l
AsHTML.HTMLelementsintheresultareprocessedanddisplayedasHTMLelements.
Forinstance,<b>this is bold</b>willbedisplayedasthis is bold.Thisisthe
defaultsetting.
l
Astext.Thisinsertstheresultas-is,meaningHTMLtagsandelementsaredisplayedas
textintheoutput.Inthisscenario,"<br>"showsupinthetextanddoesnotinsertaline
break.ThisisthepreferredsettingiftheHelperproducesplaintext.Itwillbeslightlyfaster
thanHTMLsinceitavoidsprocessingwithanHTMLparser.
8. ClosetheWizard.ThenewHelperappearsontheScriptspaneunderControlScripts.
9. Nowallyouhavetodoisdrag the HelperfromtheScriptspaneintothetemplate.Alternatively
youcanwritethenameoftheHelperenclosedindoublecurlybrackets:e.g.{{MyHelper}}.Do
thisanywherewhereyouwanttheresulttobeinserted.
Tip: Whenoneoftheincludeddatafieldsisempty,therespectiveline,includingtheprefix
andsuffix,isskipped.Theresultwillbeshorter,causingtherestofthecontenttomoveup.
If,inaPrintcontext,youdon'twanttheresultofaHelpertobepartofthetextflow(for
example,whenaletterisgoingtobesentinanenvelopewithawindow),puttheexpres-
sionthatcallstheHelperinapositionedbox(see"Boxes"onpage623and"Howtopos-
itionelements"onpage686).
Variable data in text: scripts and placeholders
OLConnectversionspriorto2022.2usedtoinsertvariabledatainatemplateviascripts and place-
holdersinsteadofexpressions.Expressionslooklikethis:{{FieldName}}.Anexpressionworkswithout
ascript.Theadvantageofexpressionsisthatfewerscriptsandsometimesnoscriptsatallareneeded
inatemplate.
Placeholderslooklikethis:@FieldName@.Ifyourtemplatewasmadewithapreviousversion,youwill
normallyseeaplaceholder-andascript-appearwhenyoudragafieldfromtheDataModelintoyour
template.
Doyouprefertoworkwithexpressions?Right-clickthesectionintheResourcespane,selectProp-
ertiesandchecktheoptionEvaluate Handlebars expressions.Forfurtherinstructionssee"Variable
dataintext:expressions"onpage722.
However,ifyouwanttogetfamiliarwithscriptinginOLConnect,insertingvariabledataplaceholders
maybeagoodstartingpoint.Thiswillgiveyouanunderstandingofhowplaceholdersandscriptswork.
Page 726