# \[Solved\] Fail to parse json received by BLE

**URL:** <https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [October 30, 2023, 9:43pm UTC](https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374 "2023-10-30T21:43:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xe.leblanck8vhn](https://avatars.discourse-cdn.com/v4/letter/x/e99b99/32.png) [@xe.leblanck8vhn](https://community.thunkable.com/u/xe.leblanck8vhn)\
**Post date:** [October 30, 2023, 9:43pm UTC](https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374/1 "2023-10-30T21:43:08Z")

</div>

Hello everyone,

I’m trying to parse a json string received by BLE (sent by an ESP32).  
I’m able to receive the raw message which seems correctly syntax, ex :

`{"commande":"changeToSetting","mode":"off","gain":[15,15,15,15],"threshold":[1,2,3,4],"current":[2.958750248,15.13124943,5.066249847,15.12843895],"stopDelay":255}`

But all my attempts to parse the message an get data are failed, example below is desperately writing “null” in “test2” with a valid json in “test”

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/3/33e33426238a4071533c69ecb2f36050ff715dcb.png)

Thank in advance for your advice,  
Xavier

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [October 30, 2023, 11:45pm UTC](https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374/2 "2023-10-30T23:45:05Z")

</div>

So close. Set your variable differently.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 31, 2023, 12:00am UTC](https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374/3 "2023-10-31T00:00:26Z")

</div>

You’re setting the value of a variable called [value of app variable jsonReceived]. So if The value of app variable jsonReceived is “Test” then you’d be setting the value of the variable “Test”. Instead, use the set app variable block at the top of the Variables drawer. The one that just says set app variable jsonReceive to “”.

---

<div class="post-metadata">

**Author:** ![xe.leblanck8vhn](https://avatars.discourse-cdn.com/v4/letter/x/e99b99/32.png) [@xe.leblanck8vhn](https://community.thunkable.com/u/xe.leblanck8vhn)\
**Post date:** [October 31, 2023, 5:55am UTC](https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374/4 "2023-10-31T05:55:06Z")

</div>

**MARK SOLVED** Thanks, I fixed with your support!

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [October 31, 2023, 1:09pm UTC](https://community.thunkable.com/t/solved-fail-to-parse-json-received-by-ble/2672374/5 "2023-10-31T13:09:54Z")

</div>

Closed on October 31, 2023, 1:09pm UTC


