Hi! I'm wondering if there's a more efficient way to accomplish what I'm doing here.
I'm using the FlightRadar24 Node, and the goal is that I want to generate a return-separated list of all of the flight registration numbers that it sees when activated.
Here's the flow that I made that accomplishes this, but I can't help but to think there's a more efficient way of doing it.
The challenge that I'm having is is that it returns each flight as its own msg.payload, rather than an object containing all of the flights.
[{"id":"e078e36c.5ea4d8","type":"tab","label":"FlightRadar24","disabled":false,"info":""},{"id":"847e74f7.1ff67","type":"flightradar24","z":"e078e36c.5ea4d8","lat":"34.129299","latType":"num","lon":"-88.640327","lonType":"num","name":"","x":390,"y":420,"wires":[["341310fb.aee5e","6492175.a155068"]]},{"id":"c9a0c1b4.a9f078","type":"inject","z":"e078e36c.5ea4d8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":260,"wires":[["c1a25886.0012b8"]]},{"id":"341310fb.aee5e","type":"debug","z":"e078e36c.5ea4d8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":590,"y":380,"wires":[]},{"id":"ce0e65b0.3f7748","type":"change","z":"e078e36c.5ea4d8","name":"","rules":[{"t":"set","p":"reglist","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":420,"wires":[[]]},{"id":"4eb68d95.03e6ac","type":"debug","z":"e078e36c.5ea4d8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1050,"y":380,"wires":[]},{"id":"c1a25886.0012b8","type":"change","z":"e078e36c.5ea4d8","name":"","rules":[{"t":"set","p":"reglist","pt":"flow","to":" ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":340,"wires":[["847e74f7.1ff67"]]},{"id":"cbff6f12.04444","type":"function","z":"e078e36c.5ea4d8","name":"","func":"var reg = msg.payload.registration+\"\\n\"\nvar list = flow.get(\"reglist\")\n\nmsg.payload = reg+list\nreturn msg;","outputs":1,"noerr":0,"x":890,"y":420,"wires":[["ce0e65b0.3f7748","4eb68d95.03e6ac"]]},{"id":"6492175.a155068","type":"delay","z":"e078e36c.5ea4d8","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"20","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":600,"y":420,"wires":[["2155f826.78d03"]]},{"id":"2155f826.78d03","type":"switch","z":"e078e36c.5ea4d8","name":"no nulls","property":"msg.payload.registration","propertyType":"msg","rules":[{"t":"nnull"}],"checkall":"true","repair":false,"outputs":1,"x":760,"y":420,"wires":[["cbff6f12.04444"]]}]