# Firebase function bug

**URL:** https://community.thunkable.com/t/firebase-function-bug/719940
**Category:** Questions about Thunkable X
**Created:** [August 4, 2020, 1:13pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940 "2020-08-04T13:13:17Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![infoim70on](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@infoim70on](https://community.thunkable.com/u/infoim70on)
#### Post date: [August 4, 2020, 1:13pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/1 "2020-08-04T13:13:17Z")

</div>

I am wondering if it is a known bug.

Since there are already too many blocks, I move some code into a function. From the left-hand side, it calls the function from the right-hand side. If I remove showList function call, the cloned record will be 1,2,3 which is normal. However, if I call the showList, it will become 1,1,1,1.

Does anyone know what’s going on? Thanks!

 ![Screenshot 2020-08-04 at 21.09.51](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/9/89f23a3b079ac71a697e0b9ed2fba03c8fd8b1dc.png)

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 4, 2020, 1:59pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/2 "2020-08-04T13:59:30Z")

</div>

Your question is quite difficult to answer, because, first, the whole scheme of calls is unclear (you probably use asynchronous calls), second, app blocks now work strangely and it is better to use something else instead of them, and third, after the latest updates, clone blocks began to work in a way that I personally do not understand.

---

<div class="post-metadata">

### Author: ![infoim70on](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@infoim70on](https://community.thunkable.com/u/infoim70on)
#### Post date: [August 4, 2020, 2:00pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/3 "2020-08-04T14:00:49Z")

</div>

What do you mean by the app blocks working poorly? Is there any option that I can look into?

Thanks!

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 4, 2020, 2:08pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/4 "2020-08-04T14:08:49Z")

</div>

There are regular problems with app variables, which is why I personally don’t use them much.

---

<div class="post-metadata">

### Author: ![infoim70on](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@infoim70on](https://community.thunkable.com/u/infoim70on)
#### Post date: [August 4, 2020, 2:10pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/5 "2020-08-04T14:10:40Z")

</div>

Can you explain a little bit more the problems of the app variables? What would you suggest in that case?

Since I need to compare the user list and return a new list, I need to declare various variables for comparison. I also find out that the variable will not be accessible if the variable is being update within the firebase get method.

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 4, 2020, 2:12pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/6 "2020-08-04T14:12:26Z")

</div>

Currently, they have this problem: the values are not updated.

---

<div class="post-metadata">

### Author: ![infoim70on](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@infoim70on](https://community.thunkable.com/u/infoim70on)
#### Post date: [August 4, 2020, 2:12pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/7 "2020-08-04T14:12:54Z")

</div>

Any workaround for this problem?

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 4, 2020, 2:15pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/8 "2020-08-04T14:15:05Z")

</div>

> [@Initialized App variable at initial screen not able to be changed after](http://community.thunkable.com/t/initialized-app-variable-at-initial-screen-not-able-to-be-changed-after/718616/2):
>
> The problem is that app variables don’t work right now. Use other components or blocks instead. I would do this [изображение]

Other users suggest using stored variables. You can also use LocalDB

---

<div class="post-metadata">

### Author: ![infoim70on](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@infoim70on](https://community.thunkable.com/u/infoim70on)
#### Post date: [August 4, 2020, 2:19pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/9 "2020-08-04T14:19:05Z")

</div>

got it so what you are doing is putting the value into alert, then retrieve it from another screen. I guess I would simply use stored variable as my variables include other data type.

By the way, what do you think about Firebase REST API? Is it better than the default firebase block?

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 4, 2020, 2:26pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/10 "2020-08-04T14:26:05Z")

</div>

It doesn’t really matter what you use to transmit data. What matters is how much data can be transmitted in different cases. I can use Alert to pass both objects, a list, and something else, but it may have limitations and may pass less data than a stored block.

Unfortunately, I’m only familiar with the AirTable REST API and I like It. If I have the opportunity, I will also look at the Firebase REST API.

---

<div class="post-metadata">

### Author: ![infoim70on](https://avatars.discourse-cdn.com/v4/letter/i/47e85d/32.png) [@infoim70on](https://community.thunkable.com/u/infoim70on)
#### Post date: [August 4, 2020, 2:28pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/11 "2020-08-04T14:28:53Z")

</div>

Really thanks for the advice!

Btw, I want to ask you one more question as below.

I know that the Realtime\_DB1 is basically async, is it correct that the updated value will only be accessible within the async? Thanks!

 ![Screenshot 2020-08-04 at 22.27.14](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/e/6e6561663fe7bd95077f4e2e338550d50a31b861.png)

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [August 4, 2020, 2:34pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/12 "2020-08-04T14:34:49Z")

</div>

All purple blocks work in asynchronous mode and the result of execution is passed to “then do”, where you should get it. For this reason, Label20 in your drawing will get incorrect data, because the asynchronous block may run later than the block that follows it.

![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/191d4a34c46cb4e712743fb718110705efe6375a.png)

---

<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, 12:26pm UTC](https://community.thunkable.com/t/firebase-function-bug/719940/13 "2024-11-08T12:26:48Z")

</div>


