i want to extract the Name of a variable and use it as a string.
For instance i have multiple sets of temperatures. Every set has different names for the temperatures and the names could Change.
So i would like to get the name from the payload to title switches and for names in Charts.
If you select the chart node, click the "i" or book button, you will find information on how to set the name of the chart dynamically using the mustache syntax.
The label can also be set by a message property by setting the field to the name of the property, for example {{msg.topic}} .
Oh thats a missunderstanding.
i would like to know how i get the Name of the variable.
before i can set the names in the Chart, i Need to get them first
When creating the message, would it be possible to add a field e.g. "varname", and set it to the name of the field you want? You can then extract it as "msg.varname".
Yea, good idea.
that would be possible and will my solution if i dont find an other way.
The messagesetup will be made by different persons and i want to make it as simple and as less work as possible for them.
There will be around 50 values that have to be changed every some weeks.
If i could make it possible in node red it would be better.
Do you have control over where that string is generated? If so then it would be better to encode it as a json string. {temp: 23} then in node red feed that through a JSON node to convert it to a js object. If there is more than just temp1 then the whole set could be json encoded.