ScrollView auto-scroll to bottom

Hello! How can I achieve that standard setup? Scrollview contains a label that populates with text (like a log). Scrollview should always be scrolled to the bottom once the new text is added, so I can see the last lines.

I’m talking about runtime.

I tried to change verticalScroller.value to verticalScroller.highValue, but no luck as highValue is always negative.
Tried to change verticalScroller to 1.
I tried to move the inside container, and it kind of works but the scroll knob didn’t move.
I tried ScrollTo(), but it doesn’t work as well, as the Label is the only object.
Tried to do all that after waiting for a frame. Nothing worked for me.

I think it’s a standard setup for any ScrollView to be able to auto-scroll to the end, am I missing something?

I’m using Unity 2021.3.
Thank you!

The scrollOffset property can be used for this.

If label is inside scroll view this will scroll to the end of it:

scrollView.scrollOffset = label.layout.max - scrollView.contentViewport.layout.size;

This will scroll to the end of the whole scrollview regardless of what is inside:

scrollView.scrollOffset = scrollView.contentContainer.layout.max - scrollView.contentViewport.layout.size;

Thank you! It works!
I only had to wait for one frame before it.