# Re-order repeating group with drag and drop

**URL:** <https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853>\
**Category:** Need help\
**Created:** [February 12, 2021, 1:17pm UTC](https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853 "2021-02-12T13:17:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rispoli.mar2803](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rispoli.mar2803](https://forum.bubble.io/u/rispoli.mar2803)\
**Post date:** [February 12, 2021, 1:17pm UTC](https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853/1 "2021-02-12T13:17:03Z")

</div>

Hello everyone . I ran into new problem. I am using this plugin

> **[Sortable RG - Drag & Drop Plugin for Bubble, by Zeroqode](https://bubble.io/plugin/sortable-rg---drag--drop-1585393064893x457741439624806400)**
>
> Sortable RG - Drag & Drop Plugin page on Bubble, by Zeroqode. Add Sortable RG - Drag & Drop in one click to your app. Bubble lets you build web apps without any code.

This plugin works correctly. However, there is one thing I don’t understand. I am attaching a short video.  
 ![ezgif.com-gif-maker (1)](https://us1.discourse-cdn.com/bubble/original/3X/1/8/187a136bfb38c09bc1994b521e3e3d4bc495feb0.gif)

As you can see the number on the left represents the id of that element. The number on the right represents the index of that element. When I change the position, the element index does not change.  
What I would need is this, once I reordered that list I wish I could also have a simple id sorted by how I moved them. For example:  
Initial values ​​134,135,136.  
After moving them I would like to get (for example)  
135,134,136, based on how I moved them. However I have not been able to get this result and the index never changes.  
Has anyone run into such a problem and managed to solve it?

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [February 12, 2021, 1:43pm UTC](https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853/2 "2021-02-12T13:43:31Z")

</div>

Hello!

The index is a vanilla Bubble function to indicate the order number of rows in repeating groups.

Create number type fields (dB or custom states as you see fit) to hold the initial index number in one. In another one add or substract the “drags” using the initial value of the row.

Hope this helps 👍🏻

---

<div class="post-metadata">

**Author:** ![rispoli.mar2803](https://avatars.discourse-cdn.com/v4/letter/r/8e8cbc/32.png) [@rispoli.mar2803](https://forum.bubble.io/u/rispoli.mar2803)\
**Post date:** [February 12, 2021, 1:47pm UTC](https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853/3 "2021-02-12T13:47:27Z")

</div>

forgive me you could be slightly clearer, can you give an example?

---

<div class="post-metadata">

**Author:** ![cmarchan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/cmarchan/32/253062_2.png) [@cmarchan](https://forum.bubble.io/u/cmarchan)\
**Post date:** [February 12, 2021, 1:56pm UTC](https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853/4 "2021-02-12T13:56:08Z")

</div>

I was referring to whatever math is necessary to achieve your described function.

With custom states you could do the calcs during the browser session and when done save to the dB if needed.

With updating your row records directly (dB) is also another slower alternative.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 23, 2021, 1:17pm UTC](https://forum.bubble.io/t/re-order-repeating-group-with-drag-and-drop/135853/5 "2021-04-23T13:17:10Z")

</div>

Closed on April 23, 2021, 1:17pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
