2022.2

Table Of Contents
Thehtml contentnodecreatesasetofwebpages,usingtheWebcontextinaConnecttemplate,and
storesthemintheFileStoreorservesit.
Ifthetemplatedoesn'tneedanydata,setmsg.payloadtoanemptyJSONstring:{}.
Ifthetemplateshouldbemergedwithdata,thedatacanbetheoutputofanothernode.Nodesthatout-
putdatathatcanbeusedbythehtmlcontentnodeare:
l
AnHTTP innode.Itwillpassanyqueryparametersviathepayload.Queryparametersarekey/-
valuepairsattachedtotheendofanURL.ThefirstparameterisappendedtotheURLusinga?
(questionmark).Iftherearemultipleparameters,an&(ampersand)isaddedinbetweeneach.
Example:http://localhost:1881/hello?first=Peter.Notethatinordertousethemasdata,thepara-
meternamesmustmatchfieldnamesinthetemplate'sdatamodel.
Theflowshouldendwithahttp responsenodewhichservestheHTMLoutput.
l
AnOLConnectdata mappingnodewhichretrievesdatafromthejobfile(suchastherequest
XML).InadditiontocreatingrecordsintheConnectdatabase,thistaskcanoutputthe(IDsof
the)records.
l
AnOLConnectdata getnodewhichretrievesanexistingrecordsetfromtheConnectdatabase.
l
Astandardcreate filenodethatcreatesaJSONfile.
l
Etc.
Whichnodeornodesfitbest,dependsonwherethedatacomefrom.
Thehtmlcontentnodeacceptsruntime parameters.Thesecanbepassedviatheparametersprop-
ertyofthemsgobjectwhichispassedbetweennodes.Forexample,aruntimeparameternamed
brandIdwouldbepassedviamsg.parameters.brandId.
Tip: Useachangenodeorfunctionnodetosetaproperty.Seealso:"Node-RED:nodesand
commontechniques"onpage184.
Files used in an OL Connect web flow
BeforecreatingthewebflowintheeditorofNode-REDyouwillneedtocreate:
l
AtemplatewithaWebcontext.(See"Creatingatemplate"onpage415.)
l
IftheHTMLfileshouldcontainvariabledata,youmayneedtocreateadatamappingcon-
figuration(see"Creatinganewdatamappingconfiguration"onpage200).Iftheinputisgoingto
beJSONdata,youcouldaddthemtothedesignusingaJSONfile(see"AddingJSONsample
data"onpage720).
Notethatbeforetemplatesanddatamappingconfigurationscanbeusedinaflow,theymustbesentto
theOLConnectserverseparately.ThiscanbedonefromtheDesigner(see"SendingfilestoConnect
Page 196