Trying to dynamically scroll to new data in a repeater on update

advanced-prototyping

#1

Hello,

I downloaded a chat bot project from this thread

  1. And I’ve added a scroll to (rectangle) action to the chat bot reply.
  2. The scroll to is scrolling where I want- at first
  3. however as more text is added the action will first scroll to the original position and then repeat each previous scroll action
  4. I’m assuming it is because the repeater is repeating the previous actions (which makes sense)

I would like to scroll to the most recent reply but I’m not sure where to start.

Chatbot_Test.rp (78.5 KB)

Thank you,
JD


#2

Hello,

What you said in #4 is correct - the repeater loads up each item, one by one, and because it loads the scroll action for each one, it scrolls for each.

One way to solve this is to add a condition to your scroll action: “If value of [[Item.isLast]] equals true”. Then, it will only scroll if it’s loading up the last item in the repeater.

Here’s the modified file: Chatbot_Test_modified.rp (78.9 KB)

-skb


Chat / Chatbot samples?
#3

Thank you, that is exactly what I was looking for. I’m assuming that “Item” and “.isLast” is derived from the repeater dataset? Is there a list or button somewhere that I’m missing? Sorry for the noob question, I’m new to axure, so I think I’m overlooking where to click. :slight_smile:

Thanks again,
JD


#4

Hi JD,

The list is a bit hidden and hard to find. But yes, there is a list of Repeater and Item properties you can access. To find it, first click the function (fx) button.

Then, click the “Insert Variable or Function” link, and you’ll find the Repeater and Item properties listed under: “Repeater/Dataset”:

There are some helpful explanations in this thread.

In particular, this comment has a lot of info.

Hope that helps!
-skb


#5

yes- awesome! thank you so much. I feel like it’s 2001 and I’m hunting down bits of script in a flash animation. Thanks again- you’ve been extremely helpful.

JD


#6

You’re so welcome. I love repeaters - you can prototype just about anything once you get the hang of the Item properties. Enjoy! :slight_smile:

-skb