Use drag and drop to bump each cell up or down one position in repeating group

Hey all, I used the following tutorial to get drag-and-drop working (sort of) Drag - Drop Reorder Your Repeating Group. This seems to be the predominant forum post on getting drag-and-drop to work, and it was helpful. However, the issue with it is that it swaps the position of the cell dragged with the cell it is dropped on. So for example, cells are in a repeating group from 1-10, with 1 being on top and 10 being on bottom, if you drag something from position 6 to position 1, it will put the cell formerly in position 6 into position 1, but then it puts what was formerly in position 1 into position 6.

What I would like is if I drag something from position 6 to position 1, then the information that was previously in position 1 will move to 2, and what was in 2 will move to 3, what was in 3 will move to 4, and so forth.

Hopefully someone can help out. Thanks in advance!

You need to link the sort order on your data type to the current cells index value…then have workflow events to change all the data accordingly as things move around.

It is a bit complex and took me a couple days but I eventually put something together that enabled me to do this.

drag n drop (1)

This is set up to be for a tour itinerary…the times on the left remain the same according to their cell index…the sort orders on the right remain the same according to their positioning in the repeating group as it again is using the cells index

lots of conditionals and searches…not the most efficient way to do it, but I think it gets as close as can be.

I ultimately decided against the drag and drop…as cool as it seems, it sometimes could be exchanged for a simpler approach using an input or up down icons to rearrange things.