Where is item.index in repeaters?


I would like to access a repeater item by its index, but most of the repeater properties are gone!

Does anyone know what happened and how can I get to the item index?

Thank you

I’m not sure which dialogue you’re in there, but I think you would need to define a local variable and point it at the repeater in order to access item.index. Good review of that in this thread.

1 Like

Hello Davegoodman

This is the Interaction Editor, it’s the same everywhere.
What I wanted to do in particular is access all items where index is less than a global variable - so, show the first x items.
This used to be possible easily. Now doesn’t seem like it.

Apologies, I’m not clear what you’re trying to achieve - are you trying to apply a filter to a repeater, or access a repeater and then set text on a widget based on what you get back? You’ll see different items available in the picker in the interaction dialogue depending on what you’re doing.

Perhaps if you post your .rp file with a summary of what you’re trying to do?

Did you try it?

Just type [[item.index]] and see if it works. You don’t have to use that drop-down and as I recall it isn’t a comprehensive list.


The interaction editor is not the same everywhere. Item.index is only offered when in the context of the repeater row. To those who haven’t used item.index, it gives you the numerical index of the “current” row.

If you click on a widget within the repeater you can find out its row index, because that widget knows which row it’s sitting in. E.g., “You clicked me and I’m on row 12.” Item.index is a valid query in this context.

Likewise, the Item Loaded event has a strong “current row” context, because this event walks through each row in order to execute its code on that row, (This article goes into excruciating detail about how Item Loaded works.) Item.index is a valid query in this context.

But if you tap a button outside of the repeater, you can’t access the current row of the repeater, because what does “current” even mean in that situation? Which is why Item.index isn’t offered there.

I’m assuming you are trying to access Item.index from a widget outside of the repeater, correct?

The good news is that you can use the “listener method,” which behaves largely the same way as Item Loaded, but you can effectively use it to to gather information from particular rows, update the states of row widgets on particular rows, etc., from outside of the repeater.

What specifically are you trying to accomplish? I’m certain it’s achievable using the listener method.

1 Like

Thank you for all your replies. I need to take a closer look.
What I’m trying to achieve - and maybe this is a little crazy - but I wanted to simulate a chat with a chat bot.

I have a repeater with 2 columns: 1 - Question; 2 - Response.

Only the first row in Questions is filled in with a “Hello” text.
The Responses are prefilled with “responses”.

There is a text area on the screen and a “Send” button. There is a global variable “i” for iterating the discussion.

The idea is, that on page load, only the first Question and Answer are displayed.
Then the user types in their question, clicks “Send”.
“i” increments by 1
The question is stored in “Questions”
The next Response is displayed (even if it’s bogus).

I’m attaching the RP file which I have no idea what to do next :slight_smile:

I’m sure there are many ways to do this, like transition through dynamic panels, but… I kind of got stuck on this idea and it’s not letting me rest.

Dorotarepeater_chat.rp (56.3 KB)


You can use a filter in this case. A filter works in the context of the current row, because it goes through each row and decides which rows survive the filter. So in a filter you can use item.index. A filter should always return a true or false answer: If it’s true, the row shows, if not, it’s hidden.

This filter is what you want in the Rule field:

Add filter [[Item.index >= i]] to Repeater

…assuming i is your global variable. On Load of the page you’ll want code like this:

On Page Load
  Set global variable i to 1
  Add filter [[Item.index >= i]] to Repeater

Note that simply changing the value of i won’t cause the filter to re-evaluate: you will need to reapply the filter (removing other filters) each time you change the value of i to get this to work.

Thank you Joseph!

It works (only the condition is <= ;))

1 Like