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":"https://dmigw.govcloud.dk/v2/oceanObs/collections/observation/items?period=latest&stationId=9004201&api-key=621f8fd3-6f36-4616-932b-30b0d3b3b71c","rel":"self","type":"application/geo+json","title":"This document"},{"href":"https://dmigw.govcloud.dk/v2/oceanObs/collections/observation/items?period=latest&stationId=9004201&api-key=621f8fd3-6f36-4616-932b-30b0d3b3b71c&offset=1","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.