Correctly index repeating group cell within a RG with multiple pages

Hey All,

Another pin to save a few some googling. This is for displaying the index (AKA count number) of an item/cell within a repeating group with fixed rows with multiple pages. Presently, while the repeating group element actions: show previous, show next, along with the dynamic RG page number function work great, the cell index function doesn’t intuitively follow suit.

ie. If I have a fixed group with 10 rows with a “current cell index” field and 15 results, the first page will display indexed results, 1-10 correctly, however navigating to next page page, will show results, 11-15, still – and incorrectly (for my purposes) as 1-10. (Even as page display reads, page 2).

I realized the current cell index ONLY reports its cell index within the current, fixed row group, not of the TOTAL search results being displayed. I’m sure there’s a reason for this, but its not for what I was going for. So here’s my workaround.

Instead of Screen Shot 2021-02-04 at 11.34.07 AM

Use the following function (keeping in mind Bubble performs arithmetic operations left to right (NOT using the Please Excuse My Dear Aunt Sally method, as was beat into all of our heads as correct order of operations)):

RG’s page number - 1 * (# of rows in your fixed group) + Current cells index

So item 11 in a RG of 10 fixed rows calculates as: 2 -1 = 1 >> 1*10 = 10 >> 10+1 =11

Screen Shot 2021-02-04 at 11.35.33 AM

An item 112 in the same repeating group, calculates as: 12-1 = 11 >> 11*10 = 110 >> 110 +2 = 112
and so on.

For configuring the "Showing page – of – " I used
Screen Shot 2021-02-04 at 12.10.53 PM

I’m sure there’s other workarounds, this is just I how I troubleshooted it.

Hope this helps someone.

Happy Building :slightly_smiling_face:

7 Likes

You should check out the list shifter plugin…it has a lot of built in functions to keep track of items in a list and pagination, plus some other features that may help you with some future issues in terms of keeping track of the items in your repeating groups

I didn’t know about that plug in. That’s wonderful. Thanks for sharing!