[Solved] Fail to parse json received by BLE

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”

Thank in advance for your advice,
Xavier

So close. Set your variable differently.

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 “”.

1 Like

MARK SOLVED Thanks, I fixed with your support!

1 Like