Referencing other than a current' cell's data in a repeating group

Repeating groups make it easy to reference the current cell’s data for that group in a text element. But what if I wanted a column to list the data in a text element starting from the second (or other ) item in the databases list?

So, for example, instead of my repeating group showing items (1 to n) from the database in corresponding rows (1 to n) in the repeating group’s column, I wanted the column to show items (2 to n) - even if that left the final row empty?

Not exactly sure what type of layout you’re proposing here, but note that the various list operators can be used to limit / alter what data appears in a Repeating Group. You already understand how to grab items from the database as a list, but note that you can further limit that using operators like :item #, :items from #, and :items until #.

So, for example, if I have a list of things “Do a search for… Things (various criteria, sorted by something)” with n items in it, I could pare the list down by one item (omitting the first item) with the expression:

Do a search for… Things:items from #2

Here’s a picture:

The :item operators are essentially another level of dynamic filtering that one can apply to lists.

There are other funkier ways to accomplish the same thing. For example, if you stashed the results of that search in a custom state somewhere, you could then operate on that copy of the search results with “set state” actions like “remove” (remove a specific item from the list), “remove list” (remove several items from the list by specifying them as a list), etc.

Hope that helps!

1 Like

Thanks Keith. I totally understand the “items from” approach you mentioned. But, being applied to the repeating group, that should only allow me to the create a column that lists items (2 to n) . What I want is for the same repeating group to have one column listing items (1 to n) and another column listing items (2 to n). So i tried your approach in a text box, instead of the repeating group data source, but it caused the text box to list everything from items (2 to n) in each cell of the column. What I need is for one text boxes to be “current cell’s item” and the other to be something like search for items with an item index of (current cell’s index + 1).
Hope this makes sense!

Look, since I can’t see what you’re imagining, I can’t really help. What you’re talking about requires multiple Repeating Groups. For example, a horizontal repeating group with vertical repeating group inside of it.

Depending upon what you’re visualizing, what you want to accomplish may not be possible (or easily possible) in Bubble.

When people describe very complicated-sounding stuff like this, my impulse is to say, “Dude, why would you need to do that?” Surely there’s a much simpler UI to accomplish the same task.

But in Bubble, there are common UI elements that require the nesting of repeating groups. Consider this, for example:

Or this:

In both cases, what you’re seeing is a horizontal repeating group with a columnar repeating group inside of it. You might want to play around with that as that’s probably where you’re going to have to go.

Ok, thanks Kevin. I will play around with that.
Basically, I’m having a user enter a series of destination addresses into a database thing. The destinations are then listed in a column of a vertical RG. I wanted an API call to a mapquest API to populate the second column in the same RG with the distances between items (i.e. detstinations) n and (n+1), (n+1) and (n+2), … so the user can see the distances between the consecutive destinations planned on a trip. I’m having trouble referencing cells n and (n+1) for the required API call’s parameters within the RG.
I’ll fiddle around with this some more, thanks again.