# Getting single value from a data string

**URL:** <https://discourse.nodered.org/t/getting-single-value-from-a-data-string/76551>\
**Category:** General\
**Created:** [14 March 2023 11:36 UTC](https://discourse.nodered.org/t/getting-single-value-from-a-data-string/76551 "2023-03-14T11:36:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrBisgaard](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@MrBisgaard](https://discourse.nodered.org/u/MrBisgaard)\
**Post date:** [14 March 2023 11:36 UTC](https://discourse.nodered.org/t/getting-single-value-from-a-data-string/76551/1 "2023-03-14T11:36:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [14 March 2023 11:43 UTC](https://discourse.nodered.org/t/getting-single-value-from-a-data-string/76551/2 "2023-03-14T11:43:50Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [13 May 2023 11:44 UTC](https://discourse.nodered.org/t/getting-single-value-from-a-data-string/76551/3 "2023-05-13T11:44:22Z")

</div>

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