# Detecting changes in Firebase - suggestions?

**URL:** <https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190>\
**Category:** Questions about Thunkable X\
**Tags:** firebase\
**Created:** [July 14, 2021, 2:02pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190 "2021-07-14T14:02:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 14, 2021, 2:02pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190/1 "2021-07-14T14:02:44Z")

</div>

All,

I’ve got grocery lists in Firebase. Eventually the lists will be shared, meaning multiple users might be making changes to the same list at once. (Different lists are no issue, but I’m thinking about my husband and I simultaneously assembling our grocery list.)

I’m using cloned blocks to display the list, so there’s not an automatic refresh like with dataviewer and listviewer. I see two options:

1. Every so often, recreate the whole set of cloned rows from fresh data. (That could be on a timer, or could be user triggered.) That’s simple and uses the code I already wrote for setting up the page to begin with. The list loading time is not too bad for first getting to the page, but I’m thinking it’s just slow enough to be annoying for a user actively working on the list. [Actually, I could trigger it with a listener - that’d be better.]

2. Do something clever. I thought I’d use a listener, but it looks like the listener returns the key it’s listening to and the FULL data under that key, not just the changed values (bummer), so I’d need to add a whole lot of listeners. Like 50 of them, if I’m watching each current item for changes.? I guess I’ll have to try that and see if there’s a performance hit. But then I also need to know if a new item has been added to the list, so I’m back to having to watch the whole list anyway. So maybe the listener just watches the list for changes and then I iterate through my cloned components to figure out what to change.

Thoughts? Input? Better option #3 that I’m not thinking of?

---

<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:** [July 14, 2021, 3:19pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190/2 "2021-07-14T15:19:00Z")

</div>

You don’t have much choice but settle to use the cloud variable initialize or change. I had a similar challenge and end up creating an `app variable object` holding the latest “grocery” list and every time the listener is triggered I first copy the object to another app variable object then run through the object comparing items to detect the change which prove to be much quicker than trying to rebuild the list in the screen.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 14, 2021, 3:21pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190/3 "2021-07-14T15:21:39Z")

</div>

Thanks for your answer, @muneer! I know how to do this with a listener, but I don’t know how to detect that a cloud variable has changed without creating a listener. This block only offers app variables.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/8/08bc0cdfcf304661fb8201fab09424ef30ef5b86.png) Can you tell me how to detect a cloud variable changing in a cloud variable way, instead of declaring a listener?

---

<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:** [July 14, 2021, 3:55pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190/4 "2021-07-14T15:55:35Z")

</div>

I do it this way

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/7/2713cff3db53907834e3ea1cc4cce763d483c00f.png)

Of course the drawback is that you cannot listen to dynamically created cloud names.

---

<div class="post-metadata">

**Author:** ![catsarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/catsarisky/32/100661_2.png) [@catsarisky](https://community.thunkable.com/u/catsarisky)\
**Post date:** [July 14, 2021, 3:59pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190/5 "2021-07-14T15:59:34Z")

</div>

Ah, now I see. I don’t have any of my cloud variables actually declared, so I wasn’t seeing the option.

My data bins are changing, so I need a dynamic option. But I can add listeners dynamically, so I’ll do it that 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:19pm UTC](https://community.thunkable.com/t/detecting-changes-in-firebase-suggestions/1396190/6 "2024-11-08T13:19:43Z")

</div>


