There is key error in my program please help

there is key error how do i clear that

please help me out

hello try to check the key “value” exists in json or not .
the error occurs when the key “value” doesn’t exist in the json object.

How to check that can u help me out

Hi @push1970.

Please remove the below line from the code"

print ("Sensor value is:" + str(data["value"]))

and add the below line instead to check the response from the Bolt cloud.

print (data)

and send me the screenshot of the output.

1 Like

how to check whether key “value” exists in json or not?

There is a typo error by Bolt
instead of this
print (“Sensor value is:” + str(data[‘value’]))
Type value under double quotes
print (“Sensor value is:” + str(data[“value”]))

That will resolve the issue !

1 Like

Yes sir, this worked out well
Thank You!!

yes, it worked in my case, thanks