Hi @sherman 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.