# \[SOLVED\] Another case of "Variable not found"

**URL:** <https://community.particle.io/t/solved-another-case-of-variable-not-found/25374>\
**Category:** Troubleshooting\
**Created:** [August 26, 2016, 8:32am UTC](https://community.particle.io/t/solved-another-case-of-variable-not-found/25374 "2016-08-26T08:32:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rasmus](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rasmus](https://community.particle.io/u/Rasmus)\
**Post date:** [August 26, 2016, 8:32am UTC](https://community.particle.io/t/solved-another-case-of-variable-not-found/25374/1 "2016-08-26T08:32:14Z")

</div>

Hi!

I have just started developing using the Photon and I am encountering an error using the Spark.variable. For some reason, every other variable name than “result” returns the "variable not found"error, regardless of the content of the Particle.variable. In the following example, I am able to read my data using [https://api.spark.io/v1/devices/ID/result?access\_token=TOKEN](https://api.spark.io/v1/devices/ID/result?access_token=TOKEN), using both the terminal (curl) or in a browser (Safari, Firefox):

```
void setup(){
   Particle.variable("result", "0,1,2,3");
}
void loop (){
}

```

results in

```
{
  "cmd": "VarReturn",
  "name": "result",
  "result": "0,1,2,3",
  "coreInfo": {
    "last_app": "",
    "last_heard": "---",
    "connected": true,
    "last_handshake_at": "---",
    "deviceID": "---",
    "product_id": 6
  }
}

```

However, any other name than “result”, e.g. “temp” or “data” gives an error:

```
void setup() {
    Particle.variable("temp", "0,1,2,3");
}
void loop() {
}

```

Produces

```
{
  "ok": false,
  "error": "Variable not found"
}

```

It should be noted that I experience this problem with two individual Photons. I am absolutely perplexed. I have read numerous other “variable not found” threads, but none of them has provided me with a solution. I hope that someone is able to help! Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [August 26, 2016, 9:21am UTC](https://community.particle.io/t/solved-another-case-of-variable-not-found/25374/2 "2016-08-26T09:21:34Z")

</div>

Could you check if these variables really don’t exist with one of these interfaces  
[http://jordymoors.nl/interface/](http://jordymoors.nl/interface/)  
[http://suda.github.io/particle-web-interface/](http://suda.github.io/particle-web-interface/)

It might also be that you need to wait a few seconds after rebooting your device for the cloud to register the new variables.  
Also make sure your code actually gets replaced on the device (e.g. add some different D7 blink patterns or `Serial.print()` statements)  
You can also look at the device events via  
[https://console.particle.io/logs](https://console.particle.io/logs)

BTW, I assume you adapted your URL along with the variable names  
[https://api.spark.io/v1/devices/ID/result?access\_token=TOKEN](https://api.spark.io/v1/devices/ID/result?access_token=TOKEN)  
[https://api.spark.io/v1/devices/ID/temp?access\_token=TOKEN](https://api.spark.io/v1/devices/ID/temp?access_token=TOKEN)  
[https://api.spark.io/v1/devices/ID/data?access\_token=TOKEN](https://api.spark.io/v1/devices/ID/data?access_token=TOKEN)

---

<div class="post-metadata">

**Author:** ![Rasmus](https://avatars.discourse-cdn.com/v4/letter/r/7993a0/32.png) [@Rasmus](https://community.particle.io/u/Rasmus)\
**Post date:** [August 26, 2016, 11:50am UTC](https://community.particle.io/t/solved-another-case-of-variable-not-found/25374/3 "2016-08-26T11:50:28Z")

</div>

> [@ScruffR](#):
>
> BTW, I assume you adapted your URL along with the variable names

No I haven't 😓

That was the problem, thanks a lot for your help!
