# Is it necessary to assign a cloud variable in a local variable

**URL:** <https://community.thunkable.com/t/is-it-necessary-to-assign-a-cloud-variable-in-a-local-variable/1561184>\
**Category:** Questions about Thunkable X\
**Tags:** cloud-variable\
**Created:** [October 14, 2021, 8:07am UTC](https://community.thunkable.com/t/is-it-necessary-to-assign-a-cloud-variable-in-a-local-variable/1561184 "2021-10-14T08:07:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![regisby-if](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@regisby-if](https://community.thunkable.com/u/regisby-if)\
**Post date:** [October 14, 2021, 8:07am UTC](https://community.thunkable.com/t/is-it-necessary-to-assign-a-cloud-variable-in-a-local-variable/1561184/1 "2021-10-14T08:07:41Z")

</div>

A somewhat stupid question.

When you display a cloud variable several times on a page, is it better to display the cloud variable directly or to assign this cloud variable to a local variable and after display the local variable.

The object of this question is to optimize the firebase accesses of my app.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [October 14, 2021, 8:18am UTC](https://community.thunkable.com/t/is-it-necessary-to-assign-a-cloud-variable-in-a-local-variable/1561184/2 "2021-10-14T08:18:07Z")

</div>

> [@regisby-if](#):
>
> A somewhat stupid question.

This is not stupid at all. Actually this is a **smart** one.

`Cloud variables` retrieve information from `Firebase RTDB` and therefore you do not want to overkill the database by unnecessary calls. In the other hand, if you are displaying the same value then you are killing the app speed by retrieving the same value again and again from the database over the internet.

For the above **two** reasons it is advisable to retrieve the value once using a `cloud variable` then assign the value to an `app variable` to use it as and when required in the app.

---

<div class="post-metadata">

**Author:** ![regisby-if](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@regisby-if](https://community.thunkable.com/u/regisby-if)\
**Post date:** [October 14, 2021, 8:39am UTC](https://community.thunkable.com/t/is-it-necessary-to-assign-a-cloud-variable-in-a-local-variable/1561184/3 "2021-10-14T08:39:22Z")

</div>

Thanks a lot Muneer. It is actually the way I worked with cloud variables. With you answeard, I know I will continue in this way.

---

<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, 1:14pm UTC](https://community.thunkable.com/t/is-it-necessary-to-assign-a-cloud-variable-in-a-local-variable/1561184/4 "2024-11-08T13:14:48Z")

</div>


