2022.2

Table Of Contents
5. Addadebugnodeandconnectthechangenodetotheinputportofthatdebugnodesothatthe
resultcanbeviewedinthedebugmessageconsole.
Setting and moving msg properties
Therearevariouswaystosetandmovevaluesofpropertiesinthemsgobject.
l
Viathechangenode.Select'Set'tosetavalue;select'Move'inordertomoveavaluefromone
propertytoanotherproperty.
l
Viathefunctionnode.ThevalueofapropertycanbesetorreplacedusingJavaScript.
Afterreadingandparsingamanifest.jsonfile,astartupflowneedstomovethenamesofsome
OLConnectresourcesfrommsg.payload.resourcestomsg.payload
l
Addachangenodetotheflow.
l
Createaruleto'Move'msg.payload.resourcestomsg.payload.
Iterating over items in an array
Ifitemsinanarrayneedtobepassedonindividually,theflowwillneedtoiterateovertheitems.This
kindofloopishandledbyNode-RED'ssplitnode.Thesplitnodeturnsasinglemsg.payload,con-
sistingofanarray,intoaseriesofmessages,eachofwhichhasapayloadcontainingoneofthearray's
elements.
Notethatthesplitnodeonlyworksonmsg.payloadandnotonitschildobjects.
Example: Astartupflowneedstoiterateoverthearrayinmsg.payloadthatcontainsthe
namesofOLConnectresources.
l
Insertasplitnodeintotheflow.
l
AddadebugnodetoverifythatNode-REDcreatesanewmessageforeach
resourcename.
Concatenating strings
Toconcatenatetwostringsindifferentvariables,onecoulduseafunctionnodeandscriptit,orusea
changenode.Example
Page 188