# Parsing JSON from Data storage

**URL:** <https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623>\
**Category:** Application Development\
**Created:** [November 11, 2019, 10:13pm UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623 "2019-11-11T22:13:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MOS-FET](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mos-fet/32/35697_2.png) [@MOS-FET](https://www.thethingsnetwork.org/forum/u/MOS-FET)\
**Post date:** [November 11, 2019, 10:13pm UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623/1 "2019-11-11T22:13:49Z")

</div>

Hello I receive the JSON as follows:

```auto
[
  {
    "degreesC": 18.39599609375,
    "device_id": "test-dev1",
    "humidity": 40.6005859375,
    "raw": "421/dg==",
    "time": "2019-11-11T21:16:31.633569185Z"
  },
  {
    "degreesC": 19.6044921875,
    "device_id": "test-dev1",
    "humidity": 37.98828125,
    "raw": "Rm4Udg==",
    "time": "2019-11-11T21:40:20.87571354Z"
  }
]

```

How can I parse it I have problems to access because of [].  
I use var `obj = JSON.parse(testi);` testi is the JSON above.  
But this don’t work when `obj.time`  
Could somebody help me?

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [November 11, 2019, 10:40pm UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623/2 "2019-11-11T22:40:20Z")

</div>

It helps if you mention which programming language you are using. We can try to guess based on the line of code but it’s easier if you tell us 😉

---

<div class="post-metadata">

**Author:** ![MOS-FET](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mos-fet/32/35697_2.png) [@MOS-FET](https://www.thethingsnetwork.org/forum/u/MOS-FET)\
**Post date:** [November 11, 2019, 11:01pm UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623/3 "2019-11-11T23:01:25Z")

</div>

ok sorry i will use Java script.  
and blockly if it goes.

```
var obj = JSON.parse(testi);
console.warn(testi.degreesC)

```

![grafik](https://www.thethingsnetwork.org/forum/uploads/default/original/3X/b/7/b7ca58041f065910ac81133c01d7f11a6c31f816.png)

---

<div class="post-metadata">

**Author:** ![jreiss](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/jreiss/32/46529_2.png) [@jreiss](https://www.thethingsnetwork.org/forum/u/jreiss)\
**Post date:** [November 12, 2019, 12:30am UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623/4 "2019-11-12T00:30:36Z")

</div>

Your input is a JSON list parsed into the obj variable.  
To access the first item degreesC property:  
`console.log(obj[0].degreesC)`

[https://www.w3schools.com/js/js\_json\_arrays.asp](https://www.w3schools.com/js/js_json_arrays.asp)

---

<div class="post-metadata">

**Author:** ![MOS-FET](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/mos-fet/32/35697_2.png) [@MOS-FET](https://www.thethingsnetwork.org/forum/u/MOS-FET)\
**Post date:** [November 12, 2019, 6:30am UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623/5 "2019-11-12T06:30:49Z")

</div>

Thanks. Oh no 😭🙈. I tried yesterday obj[1].degreesC. And I forgot 0 is first. I didn’t tried it with two objects array I had only one inside. The example json above I never tried. It was too late yesterday.

---

<div class="post-metadata">

**Author:** ![kersing](https://www.thethingsnetwork.org/forum/user_avatar/www.thethingsnetwork.org/kersing/32/44777_2.png) [@kersing](https://www.thethingsnetwork.org/forum/u/kersing)\
**Post date:** [November 20, 2020, 7:56pm UTC](https://www.thethingsnetwork.org/forum/t/parsing-json-from-data-storage/31623/6 "2020-11-20T19:56:37Z")

</div>

16 posts were split to a new topic: [Parsing payload in Python to send from RPi based node](https://www.thethingsnetwork.org/forum/t/parsing-payload-in-python-to-send-from-rpi-based-node/41501)
