# How to extract a value after splitting a JSON String in Node-RED

**URL:** <https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452>\
**Category:** General\
**Created:** [23 April 2019 10:10 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452 "2019-04-23T10:10:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![xoani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xoani/32/7844_2.png) [@xoani](https://discourse.nodered.org/u/xoani)\
**Post date:** [23 April 2019 10:10 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452/1 "2019-04-23T10:10:33Z")

</div>

I am injecting a String into my flow, then making it into a JSON String with the JSON node and splitting it with the split node. I get 5 messages out of this split node because there are 5 values with 5 properties. What I need is to extract only one of the values, to then use it in a function node. How can I do this?

[![enter image description here](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex026/uploads/nodered/original/2X/a/a672eb83221a5ff20d0c4f9e4b37643f4fa1ef2c.jpeg)](https://i.stack.imgur.com/5NATD.jpg)

This is a picture of one of the 5 outputs. What I want is to ONLY use the value (137) in a function node that should come after the split node. Thanks in advance.

---

<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:** [23 April 2019 10:18 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452/2 "2019-04-23T10:18:58Z")

</div>

If you only want one of the values out of 5 then it may be easier to just select that from the 5 rather than after the split. - what does the object with 5 items in look like ? Can you show us a debug of that ?

---

<div class="post-metadata">

**Author:** ![xoani](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/xoani/32/7844_2.png) [@xoani](https://discourse.nodered.org/u/xoani)\
**Post date:** [23 April 2019 10:25 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452/3 "2019-04-23T10:25:35Z")

</div>

Hello and thank you for your reply.

![gfhjk](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/ec310ca0921d153f6845dc1fbc8aaf8ac7381495.png)

This is how the input of the split node looks like. I thought I should split it so that I can use the value of the power in a function node.

Maybe it's easier if I just explain my goal. I want to be able to use the power value in a function node, to check if it's zero or higher. How can I extract the power value from this message? (the message will be updated every 5 seconds)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 April 2019 10:31 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452/4 "2019-04-23T10:31:44Z")

</div>

msg.payload.power\_mw should get you the value. You should be able to use this in a change node or a function

---

<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:** [23 April 2019 10:42 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452/5 "2019-04-23T10:42:14Z")

</div>

Im not sure why but this comes up time and time again. Perhaps a graphic would help?

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/56550e305e2e2cbc212d51664402a1c4f60de5da.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [23 April 2019 10:42 UTC](https://discourse.nodered.org/t/how-to-extract-a-value-after-splitting-a-json-string-in-node-red/10452/6 "2019-04-23T10:42:16Z")

</div>

If you read [https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages) it will explain how you can use the debug panels tooltips to find out the correct path to any data you can display
