# Parsing only a body string from and object

**URL:** <https://discourse.nodered.org/t/parsing-only-a-body-string-from-and-object/37732>\
**Category:** General\
**Created:** [18 December 2020 22:41 UTC](https://discourse.nodered.org/t/parsing-only-a-body-string-from-and-object/37732 "2020-12-18T22:41:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibmlmjm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ibmlmjm/32/31747_2.png) [@ibmlmjm](https://discourse.nodered.org/u/ibmlmjm)\
**Post date:** [18 December 2020 22:41 UTC](https://discourse.nodered.org/t/parsing-only-a-body-string-from-and-object/37732/1 "2020-12-18T22:41:08Z")

</div>

Hey, I have payload object with a body property of string. I want to covert the body to json object. I'm trying to use the JSON node to convert the string to an object which works great. My problem is parsing out the body. I'm trying to use the SPLIT node but it parses out everything which blows my JSON node up . I can't figure out a good method of just sending the body string to the JSON node.. Thanx for any help!

Michael

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/8609518e2e0cc86c45f74834c9728d03bdf570ae.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a82f4477198382fb1c56f99e24b753a5b08a5a49.png)

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [18 December 2020 23:06 UTC](https://discourse.nodered.org/t/parsing-only-a-body-string-from-and-object/37732/2 "2020-12-18T23:06:46Z")

</div>

Hello,  
If i understand you right you can use a change node to set msg.payload to just the body property. Copy the path of the body property from the debug and use that in the change node as set msg.payload to msg.payload.headers.body.

Johannes

---

<div class="post-metadata">

**Author:** ![ibmlmjm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ibmlmjm/32/31747_2.png) [@ibmlmjm](https://discourse.nodered.org/u/ibmlmjm)\
**Post date:** [19 December 2020 20:42 UTC](https://discourse.nodered.org/t/parsing-only-a-body-string-from-and-object/37732/3 "2020-12-19T20:42:10Z")

</div>

Thats exactly what i needed. Thanx!

---

<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:** [17 February 2021 20:42 UTC](https://discourse.nodered.org/t/parsing-only-a-body-string-from-and-object/37732/4 "2021-02-17T20:42:20Z")

</div>

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