# RealtimeDB DataChanged Refresh Issue when reopen screen

**URL:** <https://community.thunkable.com/t/realtimedb-datachanged-refresh-issue-when-reopen-screen/1652492>\
**Category:** Questions about Thunkable X\
**Tags:** firebase\
**Created:** [December 12, 2021, 12:28pm UTC](https://community.thunkable.com/t/realtimedb-datachanged-refresh-issue-when-reopen-screen/1652492 "2021-12-12T12:28:43Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [December 13, 2021, 10:02am UTC](https://community.thunkable.com/t/realtimedb-datachanged-refresh-issue-when-reopen-screen/1652492/4 "2021-12-13T10:02:19Z")

</div>

Thank you for the detailed explanation.

I can tell you that will not work for **two** reasons.

1- Starts and Opens  
These names are confusing, actually they work different that what people think. One thing for sure that if you go back to your screen using a button which uses the `Navigate to screen` block then both `Starts` and `Opens` will execute. the only time the `Starts` will not execute is when you go back to the screen using the `screen swipe gesture`.  
To overcome this issue create an `app variable` for example **Listener Active** and set it to **FALSE** whenever you have you screen active first check if this variable is false to to execute the listener block and immediately set this variable to **TRUE**. This way you will avoid adding the listener multiple times.

2- Data from the listener should be saved to variables  
Thunkable does not allow accessing the components of one screen from another screen. So if you are in screen 2 and the `DataChanged` block is in screen 1 it will execute when the data is changed in Firebase but it will fail to update labels in screen 1 because you are currently using screen 2.  
The remedy to this is to save the information into a variable and when the screen becomes active, you update the labels from the variable that was changed by the `DataChanged` block.

Hope you find it clear.

---

_[View the full topic](https://community.thunkable.com/t/realtimedb-datachanged-refresh-issue-when-reopen-screen/1652492)._
