Current cell index is always 1

I have a repeating group with fixed number of columns (1) and rows (1). I use it to display a list of videos , one at a time. There is left and right arrows at the buttom to allow shifting between videos, by workflow next/previous item action.
The data source is a user list field - a list of numbers (questions numbers that the user didn’t answered correctly). The videos are stored at another data type and selected by a search matching the video number to the question number. the videos presentations and shift work well.
I’m trying to add a progressbar by current cell index/repeating group count but the current cell index is always 1. is this related to the fact that the RG is of fixed rows 1 and columns 1?
is there any solution for this problem?

A 1x1 repeating group will only ever display 1 element. The index for that element (in Bubble) will always be 1 (and you seem to understand this).

If you want to know the position of that item in the source list, well, vanilla Bubble doesn’t have an “indexOf()” type function.

But there might be hope, in this context, because the index of the item in the source list would be the index of the “page” being displayed. However, Bubble doesn’t expose the page number for Repeating Groups (inexplicably).

So, you could put your list of videos into some other element like List Shifter (which has a pagination mode that exposes the page number see here). List Shifter also has an “indexOf” element plugin that lets you get the index of some item in some list.

Surely there are other solutions, including incrementing/decrementing a custom state each time you next/prev your videos (completely vanilla). But my proposal is an easy one.

Thanks a lot!

Just for the record: repeating groups with fixed number of cells do expose the current page number


@dorilama is correct. I was looking at an RG not in paging mode. Derp. So that’s a better solution, @yoni_g7 if you don’t need any additional functionality.

1 Like