# Extract String from Text as result from http-request

**URL:** <https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742>\
**Category:** Dashboard\
**Created:** [7 January 2021 18:50 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742 "2021-01-07T18:50:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macci2008](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Macci2008](https://discourse.nodered.org/u/Macci2008)\
**Post date:** [7 January 2021 18:50 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742/1 "2021-01-07T18:50:20Z")

</div>

I'm pretty new to node red and after accessing my hue devices I want to integrate a myStrom switch which delivers also a temperature value.  
Instead of using some palett (node-red-contrib-mystrom  
) I also could adress my the switch via http:///temp and therefore I use a http-request and a text output.

In the end it doesn't matter which way I go as the result is the same.

The result looks like this: {"measured":37.62,"compensation":19,"compensated":18.62,"offset":0}

As I want to display the result in a gauge im only interested in the value 19 - everything else needs to be deleted.

How can I achieve that ? Thanks for some hints

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [7 January 2021 19:06 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742/2 "2021-01-07T19:06:11Z")

</div>

> [@Macci2008](#):
>
> As I want to display the result in a gauge im only interested in the value 19 - everything else needs to be deleted.

You don't need to delete anything. Just use the value of interest in the UI element (or move the property you need to payload using a change node)

If you don't know how to get the correct path to the value of interest - there’s a great page in the docs that will explain how to use the debug panel to find the right path to any data item.

[https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages)

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [7 January 2021 19:10 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742/3 "2021-01-07T19:10:13Z")

</div>

> [@Macci2008](#):
>
> The result looks like this: {"measured":37.62,"compensation":19,"compensated":18.62,"offset":0}

Is that coloured all red in the debug widow?

If so in the http request node at bottom, set it to return a json object, not a utf8 string. Then use `msg.payload.compensation` to access the value

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [7 January 2021 19:11 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742/4 "2021-01-07T19:11:15Z")

</div>

though I suspect the actual temp is the compensated property

---

<div class="post-metadata">

**Author:** ![Macci2008](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Macci2008](https://discourse.nodered.org/u/Macci2008)\
**Post date:** [7 January 2021 20:21 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742/5 "2021-01-07T20:21:08Z")

</div>

thanks a lot - that helped

also thanks to the others who replied

---

<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:** [21 January 2021 20:21 UTC](https://discourse.nodered.org/t/extract-string-from-text-as-result-from-http-request/38742/6 "2021-01-21T20:21:10Z")

</div>

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