# Best Way to Parse JSON

**URL:** https://discourse.nodered.org/t/best-way-to-parse-json/62531
**Category:** General
**Created:** [11 May 2022 21:01 UTC](https://discourse.nodered.org/t/best-way-to-parse-json/62531 "2022-05-11T21:01:55Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![smarcos212](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@smarcos212](https://discourse.nodered.org/u/smarcos212)
#### Post date: [11 May 2022 21:01 UTC](https://discourse.nodered.org/t/best-way-to-parse-json/62531/1 "2022-05-11T21:01:55Z")

</div>

Hi all,

I'm looking for a way to parse the JSON that I'm receiving from a MQTT communication.  
I'm receiving the following structure:

_IOLM/port/1/pdi : msg.payload : string[163]_  
_"{"port":1,"valid":1,"uint":8716289,"PD\_ProcessData\_IN":{ "Flow":133,"Error":false,"Fixed\_output":false,"HHH\_LLL":false,"OUT2":false,"OUT1":true},"raw":[0,133,0,1]}"_

However, I would like to look only into the Flow information, such as:  
Flow:133

Thank you guys  
Regards  
Marcos

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [11 May 2022 21:07 UTC](https://discourse.nodered.org/t/best-way-to-parse-json/62531/2 "2022-05-11T21:07:24Z")

</div>

Hi @smarcos212

Configure the MQTT node to output a parsed JSON object. That will do all the work for you.

You will then be able to access `msg.payload.PD_ProcessData_IN.Flow` to access the value you mention.

---

<div class="post-metadata">

### Author: ![MecatronicaMADE](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@MecatronicaMADE](https://discourse.nodered.org/u/MecatronicaMADE)
#### Post date: [11 May 2022 22:57 UTC](https://discourse.nodered.org/t/best-way-to-parse-json/62531/3 "2022-05-11T22:57:33Z")

</div>

As @knolleary mentioned  
 ![caapture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/e/5eb4f42cd7a1538f0b68bc4794996d65fbf0c19b.png)

---

<div class="post-metadata">

### Author: ![smarcos212](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@smarcos212](https://discourse.nodered.org/u/smarcos212)
#### Post date: [12 May 2022 00:25 UTC](https://discourse.nodered.org/t/best-way-to-parse-json/62531/4 "2022-05-12T00:25:55Z")

</div>

Thank you guys, it worked perfectly!

---

<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: [26 May 2022 00:26 UTC](https://discourse.nodered.org/t/best-way-to-parse-json/62531/5 "2022-05-26T00:26:34Z")

</div>

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