Getting single value from a data string

i am having this datastring

"{"type":"FeatureCollection","features":[{"geometry":{"coordinates":[8.2225,56.7053],"type":"Point"},"id":"8fa16b3a-e601-f18b-87ed-5b7cbb8d77e2","type":"Feature","properties":{"created":"2023-03-14T11:22:34.159217Z","observed":"2023-03-14T11:20:00Z","parameterId":"sea_reg","qcStatus":"auto","stationId":"9004201","value":36.0}}],"timeStamp":"2023-03-14T11:29:24Z","numberReturned":1,"links":[{"href":"","rel":"self","type":"application/geo+json","title":"This document"},{"href":"","rel":"next","type":"application/geo+json","title":"Next set of results"}]}"

coming from a metrological station that ,among other things mesures water level..the only thing i need from this string is "value":36.0 to show on a gauge what the current water level is...

but how do i take out this data

Does this data arrive in Node-red via MQTT? If so, you can change the mqtt-in node to output a parsed JSON object.
Alternatively, pass the payload through a JSON node & it should be converted to JSON.

The value you want will then be available as msg.payload.features[0].properties.value
(Use a debug node and explore the JSON object's structure.)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.