Then the function i posted should be fine.
I would probably not use a function just a switch and template node would do
e.g.
[{"id":"d1d56bb43a743647","type":"inject","z":"b9860b4b9de8c8da","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":280,"y":360,"wires":[["77fb41b21fbb9975"]]},{"id":"77fb41b21fbb9975","type":"template","z":"b9860b4b9de8c8da","name":"simulate csv file read","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"tree,9\ncar,6\nnuts,0\nsteel,2\ntrack,2\nscreen,0\niron,3\n","output":"str","x":460,"y":360,"wires":[["8d638e0563a7991d"]]},{"id":"8d638e0563a7991d","type":"csv","z":"b9860b4b9de8c8da","name":"","sep":",","hdrin":"","hdrout":"none","multi":"one","ret":"\\n","temp":"item_name,quantity","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":310,"y":420,"wires":[["64a45997f27221c6"]]},{"id":"64a45997f27221c6","type":"switch","z":"b9860b4b9de8c8da","name":"","property":"payload.quantity","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":450,"y":420,"wires":[["601e03e46004ad35"]]},{"id":"601e03e46004ad35","type":"template","z":"b9860b4b9de8c8da","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The item {{payload.item_name}} needs to be ordered.","output":"str","x":580,"y":420,"wires":[["07a3c63a0cbcf370"]]},{"id":"07a3c63a0cbcf370","type":"debug","z":"b9860b4b9de8c8da","name":"debug 322","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":790,"y":420,"wires":[]}]