Hi everyone,
I am pretty new to Node Red and JavaScript in general. I have a question about setting a property of a message. I have the following code snippet:
var uisource = flow.get("source");
output.push([datetime, msg.payload[i][j].uisource]);
I can't figure out the syntax to put the value of the "uisource" string variable to msg.payload[i][j].***** So for example, if I var uisource = "temperature", my second line looks like:
output.push([datetime, msg.payload[i][j].temperature]);
If uisource = "light", then:
output.push([datetime, msg.payload[i][j].light]);
I need the variable uisource to change dinamically and also the identifier of the property I want to access.
Sorry if it is a very amateur question.
Thank you in advance for any help.
Örs