# Parse json to get particular value

**URL:** <https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594>\
**Category:** General\
**Created:** [24 June 2021 17:50 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594 "2021-06-24T17:50:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![iker](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iker/32/43820_2.png) [@iker](https://discourse.nodered.org/u/iker)\
**Post date:** [24 June 2021 17:50 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/1 "2021-06-24T17:50:11Z")

</div>

Hi there!

I'm struggling to get some info from an mqtt message parsed as json, as I'm unable to retrieve one of the particular values I need to further build a dashboard.  
I've made different approaches with no success.

```auto
{"Time":"2021-06-24T18:48:13","ENERGY":{"TotalStartTime":"2021-05-26T15:11:55","Total":17.266,"Yesterday":0.698,"Today":0.469,"Period":0,"Power":44,"ApparentPower":68,"ReactivePower":53,"Factor":0.64,"Voltage":221,"Current":0.308}}

```

I need to get value "Power" but just the figure, 44

Hope you can help me.

Thanks!

---

<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:** [24 June 2021 17:54 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/2 "2021-06-24T17:54:30Z")

</div>

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.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

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

---

<div class="post-metadata">

**Author:** ![iker](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iker/32/43820_2.png) [@iker](https://discourse.nodered.org/u/iker)\
**Post date:** [24 June 2021 18:21 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/3 "2021-06-24T18:21:17Z")

</div>

Thank you @Steve-Mcl but that was one approach with no success. I've tried many different ones reading different sources and I'm here asking for help, so if you could develop your answer in a more helpful way I'll really appreciate it 😉

Thanks

---

<div class="post-metadata">

**Author:** ![iker](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/iker/32/43820_2.png) [@iker](https://discourse.nodered.org/u/iker)\
**Post date:** [24 June 2021 18:38 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/4 "2021-06-24T18:38:39Z")

</div>

Reading many different posts, I finally set my MQTT Output as "a parsed JSON object" and then with a function (msg.payload = msg.payload.ENERGY.Power  
return msg;) sent to Debug outputting "msg.payload".

 ![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/153cbaebe8d6ba1931790b3de064a68f8caf1bd6.png)

I get the wanted result but also I get an unexpected error I'm unable figure out where it comes from stating "Invalid JSONata expression: Argument 1 of function "split" does not match function signature"  
 ![imagen](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/e/ce5af09a7fef3a9ad6b7c99fc66bf9e14e07fa79.png)

---

<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:** [24 June 2021 19:19 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/5 "2021-06-24T19:19:54Z")

</div>

> [@iker](#):
>
> Invalid JSONata expression: Argument 1 of function "split" does not match function signature

Do you have a change node with a JSONata expression in your flow? I can't tell unless you share more information.

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [24 June 2021 19:29 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/6 "2021-06-24T19:29:12Z")

</div>

If you put the mouse over that error message it should show you which node it is coming from

---

<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:** [8 July 2021 19:29 UTC](https://discourse.nodered.org/t/parse-json-to-get-particular-value/47594/7 "2021-07-08T19:29:33Z")

</div>

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