I have a text file that I am loading into an array which contains lots of license plates.
I have a feed coming from a camera with msg.payload of licene plate data; I want to be able to search every message coming out of this to see if it exists in the license plate array and if it does then continue...
I am using the CSV node with output single message array - how do I make this into a global that can then be read by the function that is reading the license plate data?
(As you have probably gathered I am a little new to node.red...)
OK so that seems all ok... now how do I return a different value in that object?
e.g. I have ammended the CSV so now it also has "parking" in it, which denotes which garage door they have access to... this is either a 1, 2 or 3 value and I want to return that numerical value so I can put into a switch to control the three relays
The code is already extracting 1 element out of the array (based on the plate number match)
and setting a new payload with properties from the matched object
You can set the payload to the entire matched object, given you all the properties, but you need to use payload.parking in the switch Node - or rename the CSV header for it