Press "Enter" to skip to content

Parse a number from a JSON object – Node Red

bist 0

If you need to parse json data – extract it to a value in Node Red. You can use the following code in a function.

var value = msg.payload.value;
msg.payload = value;
return msg;

Create a variable value and copy the json path after the = sign

Then store the value in the variable. Then return the msg

Example from opennweather Max Predicted Temperature:

Leave a Reply

Your email address will not be published. Required fields are marked *