Releasing a public version of a group messenger built on Bubble

Hi @sherman :slight_smile: You’re right that action doesn’t necessarily need to happen on page load (it just does anyway since it’s a Do When Condition is True workflow and the custom state begins as empty each time the page is loaded). This custom state was created to have the repeating group scroll to the bottom automatically for all Users viewing the messages, every time a new message is sent by any User. It’s a little tricky to explain, but without the workflow and custom state, the repeating group would scroll only for the Current User sending a Message (if you have a scroll action for the Current User after the Current User sends a Message), but it would not automatically scroll for other Users viewing the messages at the same time on their own computers, causing them to have to manually scroll down in the repeating group each time a fellow User sends a message.

For example, let’s say you and I both have the page open on our computers. There are 5 messages loaded in our repeating groups (which sets the Repeating Group Number custom state value to 5, after the page is loaded).

On your computer, you type a message and send the message (this changes both of our repeating group :counts to 6) which means that the “Do when repeating group:count (6) > repeating group Number custom state value (5)” will run on both of our screens. Both of our repeating groups are scrolled to the bottom, because the Do When Condition is True workflow runs on both of our screens (and any other User also viewing the page). After the scroll action occurs in that Do When Condition is True workflow, the Repeating Group Number custom state is updated from 5 to 6 for both of us as well, and our repeating groups are automatically scrolled to the bottom.

Then if I send a message back to you, the repeating group count becomes 7, the custom state is 6, so the Do When Condition is True action runs, the scroll action occurs, and the custom state value is updated from 6 to 7 (etc.). This repeats every time a Message is sent. :slight_smile:

A-ha, very nice. I see what you mean. I forgot that the workflow was run on page load, which means the custom state would be empty for the condition. Good work :+1:

1 Like

hie im having problems with this, i my repeating group i have two text boxes, one for current user on the right and the other for the other person sending the message on the left. your logic is only scrolling down for the text box on the right and the messages for the one on the left always remains ontop

Hi @cardyy :slight_smile: Can you share a link to your app editor? You can do this by temporarily setting the app to public by going to Settings --> Application Rights --> Everyone can view/or edit. (Then copy+pasting the URL to the editor here)

hie its now fixed, i sorted everything by date descending “no”, and i changed primary field on my database to date aswell, worked perfect. thanks alot anyway

1 Like

Life saver!! Thanks a lot!! Have been looking for this all over!!

1 Like

Hi Guys, Just wondering if this is still functioning correctly, i notice it doesn’t work in preview, and in the workflow there appears to be a lot of functions missing as if its been deleted or edited.

I just followed his instructions, and it worked for me. I can confirm this thread still contains the solution