Here you go, the function node is very simple. It uses https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/pop to return only the last element of the array that the csv node puts out. After this you can access the individual values by their object keys. for example msg.payload.col3
for the third element in the last row of the csv. In the example i use a change node to move this value to be the msg.payload
. You can now show this in a dashboard text node for example.
[{"id":"b78a0f69.a293c","type":"file in","z":"f954564f.03e718","name":"","filename":"test.csv","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":1620,"y":2080,"wires":[["d3a54150.86997"]]},{"id":"39953b3f.15db84","type":"exec","z":"f954564f.03e718","command":"wget --no-check-certificate 'https://docs.google.com/spreadsheets/d/1WAXIzBznSmxDqPSBzlOcqtb-6apq6xthuAYRqSUuU8c/export?format=csv' -O test.csv","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":990,"y":2080,"wires":[["b78a0f69.a293c"],[],[]]},{"id":"3aba5732.afcb8","type":"inject","z":"f954564f.03e718","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":360,"y":2080,"wires":[["39953b3f.15db84"]]},{"id":"33cd2066.beaa9","type":"debug","z":"f954564f.03e718","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":2270,"y":2080,"wires":[]},{"id":"d3a54150.86997","type":"csv","z":"f954564f.03e718","name":"","sep":",","hdrin":"","hdrout":false,"multi":"mult","ret":"\\n","temp":"","skip":"0","strings":false,"x":1790,"y":2080,"wires":[["d0642c8f.8bd5f8"]]},{"id":"d0642c8f.8bd5f8","type":"function","z":"f954564f.03e718","name":"LastElement","func":"msg.payload = msg.payload.pop();\nreturn msg;","outputs":1,"noerr":0,"x":1950,"y":2080,"wires":[["ded8c4e3.686178"]]},{"id":"ded8c4e3.686178","type":"change","z":"f954564f.03e718","name":"get3rd","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.col3","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2110,"y":2080,"wires":[["33cd2066.beaa9"]]}]