Refreshing Repeating Group Data w/o Refreshing Page

not sure isf this is of help to anyone…
I was facing a similar issue (without involving data from an external API) that the data in a RG did not “refresh” properly…What helped me was to put the RG into a group (the RG was the only element in that group) and then add “Reset data” for the RG group to the workflow accordingly…Maybe this helps at some point…

2 Likes

I have a similar problem. My repeating group displays data (messages) from my Bubble database, essentially a messaging service like WhatsApp. This new data loads in real time (e.g. user 1 sends a message, which is saved in the database, this message is displayed in the repeating group for user 2 on their phone). So this part works ok.

The problem is I want to trigger a workflow when a new message is received (e.g. a bubble at the bottom of the screen that says “new message, scroll down to view it!”). I’ve used a workflow that executes when the last modified date for the data (+60s) > current date/time. As per ANSWERED: Detecting a change inside a group with many binding fields - #2 by gf_wolfer. Essentially, the workflow is executed when there is a new message.

Similar to what @supernaturally said in his original post, this workflow only executes once when I examine in the debugger. Even though the workflow should execute every time (as per print screen below).

I’ve tried the simple “reset data” of a group, suggested by @cajudick above, with no success. I’ve also tried setting alternating custom states for the repeating group when there is a new message/data (these custom states being “even” or “odd”, depending on the number of messages loaded), so an alternating workflow is triggered each time a new message/data loads (workflow 1 if the state is “even”, workflow 2 if the state is “odd”). No success with this either, since workflow 1 executes once, then neither workflows 1 or 2 execute in the future. I suspect I have not put the “dummy parameter” in the correct place, which was the solution by @supernaturally.

To surmise, the problem is not being able to execute a workflow more than once, where the workflow is executed when there are changes in data for a repeating group. Any suggestions to solve this welcome :slight_smile:. I will continue to troubleshoot in the meantime.

30%20pm

Are you doing anything tricky for the RG data source?

I’ve found that the data can take up to five minutes to update on another client, which makes it inappropriate for realtime alerts if you want a short latency.

If you find the latency fine, then you can use Bubble’s event “Do when condition is true”, and compare the last modified date of the last entry to a value you’ve saved locally (custom state or group value).

Demo:
run time
edit view

For faster reaction time, you’d be looking at an external service, that sends a message to a script running on the page. For example, OneSignal push notifications.

Hey @mishav. Thanks for the reply :slight_smile: and creating the simple demo, it seems to work perfectly. Whereas in my project, the workflow only executes once. I must have an overcomplicated component in it, I will inspect and hopefully solve soon!

Thanks again, Sherman

Edit: I’ve found the problem in my project. If you try @mishav’s demo with the debugger mode on at full speed, the condition is triggered every time. However, if you try the demo with the debugger mode on at slow speed, the condition is only triggered once (this is the problem in my project). I suppose I need to find a way around this problem. https://test-detect-db-change.bubbleapps.io/version-test/timestamp?debug_mode=true

Can somebody explain why slow load speed (latency) would only allow the condition in @mishav’s demo to only execute once? Doesn’t quite make sense to me yet. Sherman

Yes it looks like the debugger loses the event triggers for “do when” when changing from Normal to Slow. If you set Slow, then refresh the page, they seem to work.

Could you raise a bug to Bubble on this?

2 Likes