Access element in other Repeating Group cells

@philledille No problem at all! :slight_smile: The up/down buttons approach you have is probably better for capacity reasons! Just incase you’d prefer drag and drop, I duplicated my previous demo and modified it so its only drag and drop:
Preview:

Editor:

In this example, both repeating groups display CarOrders (to make the drag/drop process more simple) and the CarOrders on the left-side can be dragged and dropped between cells:

This happens because of this workflow:


This looks complicated, but it is just telling Bubble, “When any of the Drop Area Listed CarOrder elements (found in each cell of the left-side repeating group) have any CarOrder Group dropped on it” → do the following:


  1. This changes the “Current Workflow CarOrder”'s Order field to be the Order of the cell where it was just dropped. (The “Current Workflow CarOrder” refers to the Droppable CarOrder group that was just dropped)


  2. This second action adds 1 to all of the CarOrders’ Order fields, that are beneath the Current Workflow CarOrder. This makes sure those CarOrders ‘move down’ to make room for the CarOrder that was just dropped, and keep everything in order.


  3. This third action subtracts 1 from all of the CarOrders’ Order fields, that are above the Current Workflow CarOrder. This makes sure that those CarOrders ‘move up’ to make room for the CarOrder that was just dropped, and keep everything in order.

Aside from dragging and dropping between cells, those “CarOrders” can then be removed, or ‘dragged-out’ of the left-side list to the right-side list of CarOrders:

This happens because there is a DropArea on the right side as well, and when a Draggable CarOrder group is dropped on it, the workflow sets that just-dropped CarOrder’s Order field to empty.


Since that CarOrder’s order field is now empty, it is shown in the right-side repeating group only:

And the right-side Cars can be moved to the left by dragging them between those cells as well:

Since both repeating groups are of type “CarOrder” now, the CarOrders on the right can be dragged between CarOrder cells on the left, all using the same original re-order workflow:

The reason it’s probably not the best idea for large lists is because it uses two ‘Make Changes to a List of CarOrders’ each time something is dragged between cells. This is needed to make sure the cells above the just-dropped cell move upwards by 1, and the cells beneath the just-dropped cell move downwards by 1 (If anyone knows of a different way, please let me know! :slight_smile: )

Dividing by 2 for drag and drop sometimes works, but it can also cause a few cells to have the same Order number which makes things look like the drag and drop doesn’t work.

Here is a more in-depth explanation of the drag-and-drop workflows I used for this example but feel free to let me know if you have any questions setting it up :slight_smile:

4 Likes