# \[Solved\] Cloud variable return null when installed but normal in live test

**URL:** <https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466>\
**Category:** Questions about Thunkable X\
**Tags:** solved\
**Created:** [June 12, 2020, 3:36pm UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466 "2020-06-12T15:36:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliencaocao](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@aliencaocao](https://community.thunkable.com/u/aliencaocao)\
**Post date:** [June 12, 2020, 3:36pm UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/1 "2020-06-12T15:36:51Z")

</div>

Hi, I am working on a simple check for update function of my app, and I found a very weird yet consistent bug with the cloud variable and firebase.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/e/fe25bec02cd0b34958fb720a192d0837b09c5154.png)  
As the code show, my app will get the latest build number which is an integer from my own Firebase server, and prompt the user to update if needed. This function works perfectly in live test on both ios and android, however when I install it as apk or on ios devices, the value that firebase return becomes null, and thus the message will end up not able to display the lastest build number. Instead, it just displays as if the variable did not exist. The Firebase was definitely configured correctly as my app uses a lot of cloud variables, and ONLY this particular one don’t work. Ive tried using initialise cloud variable, and use the longer way of firebase.getvalue, however both has the same bug. I also tried renaming the variable. Rebuilding the app also does not help. Is this a known bug or something that could have caused it?

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [June 29, 2020, 7:52pm UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/2 "2020-06-29T19:52:11Z")

</div>

Hey @aliencaocao - this is expected behaviour (although not necessarily wanted behaviour in your case)

Here’s an example from the #Tutorials and DIY Guides section on how to handle null values when an app is first loaded:

> [@How to Create a To Do App & Store the Items in a Stored List](http://community.thunkable.com/t/how-to-create-a-to-do-app-store-the-items-in-a-stored-list/66086/24):
>
> Hey @stevepeirson2x9p2vv, please check out this [example](http://community.thunkable.com/t/jareds-cloud-to-do-app-components-cloud-variable-diy-extended-listviewer-recursive-functions-dynamic-labels-realtimedb-authentication/502646/5) you will want to set up that variable as an empty list if it is not set as such already. see the image below. The var will equal null on load. you cant add an item to a var set as null as if it was a list without making it an empty list first as seen below or making it a list that you overwrite.

Having the variable return null the first time only is really useful for doing things like user onboarding the first time they open your app (i.e. anything your don’t want to ask them over and over again)

---

<div class="post-metadata">

**Author:** ![aliencaocao](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@aliencaocao](https://community.thunkable.com/u/aliencaocao)\
**Post date:** [June 30, 2020, 1:11pm UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/3 "2020-06-30T13:11:31Z")

</div>

No the variable isnt a null value. I set it over at Firebase and not through any blocks inside Thunkable. Anyways now it is magically working again without me doing anything.

---

<div class="post-metadata">

**Author:** ![jkjkjk](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@jkjkjk](https://community.thunkable.com/u/jkjkjk)\
**Post date:** [June 25, 2021, 9:01pm UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/4 "2021-06-25T21:01:38Z")

</div>

How??

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [June 26, 2021, 3:41am UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/5 "2021-06-26T03:41:38Z")

</div>

Hi @jkjkjk , this topic is an year old, do it isn’t a good practice to bump it. Thanks.

---

<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:** [June 26, 2021, 5:00am UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/6 "2021-06-26T05:00:38Z")

</div>

Also, if you post a question, you need to provide details about what you need, what you’ve tried and what happened. It’s best to also include screenshots of your blocks.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:25am UTC](https://community.thunkable.com/t/solved-cloud-variable-return-null-when-installed-but-normal-in-live-test/611466/7 "2024-11-08T11:25:16Z")

</div>


