# I'm completely stalled with Event listeners

**URL:** <https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714>\
**Category:** Questions about Thunkable X\
**Created:** [October 7, 2020, 7:47am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714 "2020-10-07T07:47:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 7, 2020, 7:47am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/1 "2020-10-07T07:47:12Z")

</div>

Hi Thunkers,

In my app, I had set up a listener on my loading page which referred to any changes in the Firebase RTDB Users root node.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/3/6356cc80a7e85fdb6e2be74324682617e1d2c9e2.png)

I then added The data change block to each screen where I needed the Event Listener.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/f/5fa2296019b4a25eca4e4c59c5b80359db67aaca.png)

This was working at one stage but I haven’t visited it in a while. Today, I am in the process of tidying up my app and I hit a brick wall. The listener no longer works between screens. If you navigate away and then back again the listener stops triggering and only continues to work on one screen.

I have tried to including a change Variable in just one listener block to one screen and add listeners to that variable on the other screens instead of the RTDB listener but that too does not work between screens.

Does anyone have any ideas? I am completely stalled! ☹

---

<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:** [October 7, 2020, 4:32pm UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/2 "2020-10-07T16:32:58Z")

</div>

It’s _possible_ that the # and (especially) the / characters in your variable names are causing the issue.

Is this something you can try replicate in a smaller (less important! 😂) sample app?

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 7, 2020, 10:40pm UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/3 "2020-10-07T22:40:26Z")

</div>

Thank you for your reply @domhnallohanlon

You suggestion regarding Variable names is noted with thanks.

Here is a much simpler example that doesn’t involve Firebase:

> **[Thunkable](https://x.thunkable.com/projectPage/5f7d72fbecaaa698789ab231)**

Screen two is a simple one second counter which works happily in the background.

Screen one does not trigger the event listener for Variable ‘A’ that is changing every second in screen two. By pressing the button on screen one we can see that Variable “A” is indeed incrementing however Variable “B” is not being changed as the Listener is not being triggered. If I can solve this simple problem, I can fix everything in my more complex scenario in my other app.

Thanks.

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 13, 2020, 7:33am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/4 "2020-10-13T07:33:25Z")

</div>

Hi @domhnallohanlon,

Should I expect any support with this? Any work around I come up with is extremely inefficient and messy. Listener Callbacks are essential to my application. Am I doing something silly or is this a bug?

Thanks.

---

<div class="post-metadata">

**Author:** ![bilastois](https://avatars.discourse-cdn.com/v4/letter/b/65b543/32.png) [@bilastois](https://community.thunkable.com/u/bilastois)\
**Post date:** [October 13, 2020, 8:25am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/5 "2020-10-13T08:25:48Z")

</div>

hi.

can you try the block?

i see the value of a in the screen1 when click to button.

 ![Untitled](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/5/e5ec5eae99364739ab0465d6e120eb9c36e1325f.jpeg)

---

<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 13, 2020, 8:33am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/6 "2020-10-13T08:33:40Z")

</div>

Hi @eddie.rebehy,

I changed the variabes to [cloud] and your App worked like a charm.

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/6/e6a232bb9be0d0bb99aa2b436c717a61345354c5.png)

I tested it without initializing the variables but did not work. Once the variables initialize [A] acted as expected.

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 13, 2020, 9:52am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/7 "2020-10-13T09:52:00Z")

</div>

hi @bilastois,

If the listener is working, both labels will increment every second without clicking the button.

---

<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 13, 2020, 10:01am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/8 "2020-10-13T10:01:26Z")

</div>

Hi @eddie.rebehy,  
As far as the code goes only [A] should incremented. Nothing is coded for [B] 😁

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 13, 2020, 10:09am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/9 "2020-10-13T10:09:25Z")

</div>

Yes you are right. I just changed that.

Thanks for making me aware that the listener works for initialised cloud variables.  
Unfortunately this won’t work in my case because the variable names are unknown. They are created when the user is created. Thunkable doesn’t have a block to allow initialization of a variable named variable.

let me ponder on your discovery and see if I can find a way to make it work.

Firebase is designed to work with thousands of listeners in one function. Unfortunatly Thunkable isn’t.

---

<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 13, 2020, 10:21am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/10 "2020-10-13T10:21:37Z")

</div>

Have you tried the [Data Changed] event of Firebase.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/2/72722a7e96b962abd8a689f43c5f8ea1e3ad7d5a.png)  
It returns the [key] name and the [value] of this key. Using successive if statements you can determine which [key] was changed and what action you want to take.

Just a suggestion.

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 13, 2020, 10:34am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/11 "2020-10-13T10:34:54Z")

</div>

This is what I started with. It won’t work on multiple acreens for me.

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 14, 2020, 1:35am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/12 "2020-10-14T01:35:37Z")

</div>

@muneer @domhnallohanlon

> **[Thunkable](https://x.thunkable.com/projectPage/5f7d72fbecaaa698789ab231)**

And just like that…without any communication from the Thunkable beavers… It starts working for all variable types.

Muneer; please confirm that I’m not losing my mind!

Time to test this again in my app.

🤪 🙄

edit: you may have to clear your app cache to see this working.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [October 14, 2020, 3:03am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/13 "2020-10-14T03:03:33Z")

</div>

Not variable named variables. But you can have multiple paths in one cloud variable!

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 14, 2020, 3:17am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/14 "2020-10-14T03:17:14Z")

</div>

I tried that this morning Jared by initializing cloud: users/ … then setting listeners to the users path. It still only worked on a single screen. There are definitely some inconsistencies occurring.

---

<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, 2020, 6:37am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/15 "2020-10-14T06:37:24Z")

</div>

Hi @eddie.rebehy,  
Your App works as expected. You used the screen [start] event to start a [forever] loop to increment all three variables and in the other two screens you are tracking changes using the [cloud] variable which we found that it works therefore they will all seem to be working.

However, if you changed the tracked variable in the other two screens to [app] or [stored] variable the changes will not reflect in those two screens and will only reflect in the first screen.

I don’t know if you can understand what I’m trying to explain 🤭

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 14, 2020, 6:52am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/16 "2020-10-14T06:52:48Z")

</div>

Thanks @muneer

I think I am going crazy. I thought I had three listeners on each screen. 🤪 😖

You are 100% correct. I must have been a little trigger happy with my blocks. Back to square one. ☹

I have now amended and rechecked the app. My goal is to get the other two screens working on app and stored variable listeners.

---

<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, 2020, 8:00am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/17 "2020-10-14T08:00:53Z")

</div>

> [@eddie.rebehy](#):
>
> You are 100% correct. I must have been a little trigger happy with my blocks. Back to square one. ☹

I am sorry to have caused you the disappointment. Believe me it wasn’t intended.

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 14, 2020, 8:25am UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/18 "2020-10-14T08:25:20Z")

</div>

> [@muneer](#):
>
> I am sorry to have caused you the disappointment. Believe me it wasn’t intended.

😂 Grateful to have another set of eyes on this.

---

<div class="post-metadata">

**Author:** ![eddie.rebehy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eddie.rebehy/32/67993_2.png) [@eddie.rebehy](https://community.thunkable.com/u/eddie.rebehy)\
**Post date:** [October 14, 2020, 10:10pm UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/19 "2020-10-14T22:10:47Z")

</div>

Update:

While I am still unable to get App and Stored Variable listeners to work across screens, I am able to get the RTDB listeners to work on all screens even without initializing a cloud variable, however only when I remove any type of Navigator and create my own ‘button’ screen navigation.

The anomaly of this listener only occurs inside the navigator containers. If a Navigator is used then the listener appears to be restricted to one screen only.

And still no input from Thunkable staff. Should I be using Github or some other medium to report these bugs? I am not too familiar with that.

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [October 15, 2020, 11:03pm UTC](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714/20 "2020-10-15T23:03:39Z")

</div>

Yes, report the bug to GitHub.

A few of tips for Git Hub:

Simply stating the problem within a complex app will not get you very far. As the software development saying goes, “it works on my computer”. You will need to create a clear demostration app. If you can provide both a link to the app as well as a GIF of the app behavior (I love AZ recorder on Android). It also helps to engage the Thunkable staff via DM, discuss the problem, then show them the issue. That can often get you request prioritized. I’ve found simply logging the GitHub issue will result in it being ignored. To be frank, there are a significant number of GitHub tickets that are programmer errors vs. errors in Thunkable. You can help the staff prioritize your issue by making someone on the staff aware of the issue and tagging them on your GitHub Submission.

Your pain is real.

[Next page](https://community.thunkable.com/t/im-completely-stalled-with-event-listeners/880714.md?page=2)
