Hi everyone. I’m trying to create a group chat function, with a repeating group that lists all the messages. I want the repeating group to scroll to the bottom (i.e. most recent message) whenever a new message is sent. For example, if User1 is looking at the chat, and User2 sends a message, I want User1’s screen to scroll down and reveal the message.
To achieve this I figured I would use the “trigger a custom event when data changes” function. Each chat has a “most recent message” field so whenever that changes in the database, the repeating group would scroll to the most recent message for any user with the chat open.
But I have run into trouble with the “trigger a custom event when data changes” function. In all the videos I’ve seen, there is a “field to watch” option (in my case I would watch the “most recent message” field and trigger an action when this changes). But for some reason mine doesn’t seem to have the “field to watch” option - see screenshot.
Am I missing something? Or is my overall strategy wrong. Thanks so much for your advice!
Sorry Adam I’m not following your answers here I’m afraid. Are you able to explain in a bit more detail? I don’t feel like I’m any closer to a solution! In the video I watched there is an option called “field to watch” - see this screenshot from youtube.
But mind doesn’t have this option. When I added a parameter in I still don’t get the option…
Hmm. Ok I’ve changed it. I have one custom event called “Data changes” with a parameter called ‘Most recent message’ and type ‘Thread’. (The field I want to watch is of type Thread).
Now I select the action “trigger a custom event when data changes” and I get this:
You first have to select which custom event to trigger…
Then you’ll have the option to define a thing to and a field to watch (as long as the custom event you’re triggering has a custom datatype parameter declared).
Haha, OK I think I’ll have to go look at custom events again from first principles, cause I’m just not following. If you know any good resources for an overview of custom events let me know - I haven’t really been able to find much.
Probably Bubble is preventing a workflow step triggering the same custom event that triggered the current workflow … i.e. cannot trigger itself.
Try putting the step “trigger when data changes” into a different workflow, for example in a Page is Loaded workflow.
FYI a couple of years ago I found the performance / stability of this feature didn’t match my expectations for updating a chat, hopefully it has improved