[UI Builder] How to Trigger Smooth Auto-Scroll in Repeater Container After Chat Update?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 06:28 AM
Hi Community,
I'm building a chat interface in UI Builder, where each user query and bot response is stored in a "chatHistory" client state parameter (array) and rendered using a Repeater inside a container.
The container has:
max-height: 600px;
overflow-y: auto;
Every time a new message is added, I want the chat container to automatically scroll to the bottom, so the latest message is visible without manual scrolling.
What’s the best way to achieve this in UI Builder?
Would appreciate any guidance or suggestions!
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2025 07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 01:42 AM
Hi @Mark Dooley
Thank you for responding!
Could you please clarify a few things? What is the View Reference Name — is it the same as the Component ID?
In the client script, we have the option Trigger by, but where is Trigger Type? How do we select it?
Could you please share the steps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 04:56 AM
I am getting "'setTimeout' is not defined." error

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-15-2025 08:21 AM
- View Reference Name vs. Component ID: Okay, so the View Reference Name is like giving your component a cool nickname so you can call it by that name in your script. For example, I called my chat container “chatScrollContainer” because, well, it’s exactly what it does. This is different from the Component ID, which is a name the system gives the component automatically (and let's face it, that’s usually a mess of numbers and letters that no one remembers). You set the View Reference Name manually in the properties panel of the component. You’ll use that name in your code.
- Steps to set up the View Reference Name:
- Click on your chat container in UI Builder.
- In the properties panel, look for View Reference Name and give it a name (something memorable like "chatScrollContainer").
- In your script, just use that name to grab the container, like this: api.view.getViewElement('chatScrollContainer').
- Trigger Type: The Trigger Type is kind of like setting an alarm clock for your script as it tells it when to wake up and do its job. In this case, we want it to wake up every time the chatHistory state changes (a new message!).Steps to select the Trigger Type:
- Go to the Client Scripts section in UI Builder.
- Create a new script (or edit an existing one).
- In the "Trigger by" section, pick State Change (that’s when the chat history updates).
- In the "Trigger Type" dropdown, select onStateChange.
- Then select chatHistory from the list of states to watch.