# Use object data in a string

**URL:** <https://discourse.nodered.org/t/use-object-data-in-a-string/17447>\
**Category:** General\
**Created:** [2 November 2019 23:15 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447 "2019-11-02T23:15:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![solubleinair](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@solubleinair](https://discourse.nodered.org/u/solubleinair)\
**Post date:** [2 November 2019 23:15 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447/1 "2019-11-02T23:15:50Z")

</div>

Hi,

I'm trying to connect google assistant with onkyo amp.

I'm getting resonse from homeassistant node which looks like this:

msg.payload : Object  
object  
on: false  
volume: 10

The onkyo controller node needs to get string

volume=10

How to convert object from homeassistant to string?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 November 2019 23:27 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447/2 "2019-11-02T23:27:52Z")

</div>

Hi and welcome

You can use a change node like this

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

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 November 2019 23:32 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447/3 "2019-11-02T23:32:29Z")

</div>

Sorry - missed the bit about wanting a string

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

1st bit extracts just the volume  
2nd bit uses JSONAta to convert it to a string

---

<div class="post-metadata">

**Author:** ![solubleinair](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@solubleinair](https://discourse.nodered.org/u/solubleinair)\
**Post date:** [2 November 2019 23:40 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447/4 "2019-11-02T23:40:04Z")

</div>

> [@solubleinair](#):
>
> volume=10

thank You

I need to get exatclty string:

volume=10 (volume="msg.payload.volume")

somehow cannot figure how

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [2 November 2019 23:48 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447/5 "2019-11-02T23:48:05Z")

</div>

try this then

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

---

<div class="post-metadata">

**Author:** ![solubleinair](https://avatars.discourse-cdn.com/v4/letter/s/90db22/32.png) [@solubleinair](https://discourse.nodered.org/u/solubleinair)\
**Post date:** [2 November 2019 23:50 UTC](https://discourse.nodered.org/t/use-object-data-in-a-string/17447/6 "2019-11-02T23:50:14Z")

</div>

Works perfectly! Thank You!
