# How to put a returned JSON object into a variable

**URL:** <https://discourse.nodered.org/t/how-to-put-a-returned-json-object-into-a-variable/20741>\
**Category:** General\
**Created:** [22 January 2020 19:05 UTC](https://discourse.nodered.org/t/how-to-put-a-returned-json-object-into-a-variable/20741 "2020-01-22T19:05:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grant1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/grant1/32/49890_2.png) [@grant1](https://discourse.nodered.org/u/grant1)\
**Post date:** [22 January 2020 19:05 UTC](https://discourse.nodered.org/t/how-to-put-a-returned-json-object-into-a-variable/20741/1 "2020-01-22T19:05:17Z")

</div>

We have an outdoor tank with a telemetry unit that we can access via an HTML GET request. I put the GET request into NodeRED and have it outputting the JSON object as an array, but I only care about the 2 things highlighted in yellow. What is the correct way to put these 2 values into variables that can then be used elsewhere.

 ![NodeRed for Outdoor Tank Level](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/a/2a17e133aa902fd0fb5232e40411b71ef5bc6feb.png)

---

<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:** [22 January 2020 19:18 UTC](https://discourse.nodered.org/t/how-to-put-a-returned-json-object-into-a-variable/20741/2 "2020-01-22T19:18:57Z")

</div>

Have a look at [https://nodered.org/docs/user-guide/messages](https://nodered.org/docs/user-guide/messages) to work out how to get to the parts you want - then use a change node to create a new message with the parts you want.
