Services Plugins FAQs

Sorting things/reordering in DB using drag + drop plugin

Hey ZQ team,

I’m experiencing an issue with the Drag + Drop to Reorder RG plugin, and I’m hoping you can help.

After dragging and dropping an item in my repeating group, my workflow isn’t correctly updating the moved item’s position field in the database. Instead of properly reindexing the list, I’m seeing incorrect or unexpected values, like decimals (e.g., “1.5” instead of “2”) or duplicate positions, which causes issues with sorting.

What I’ve Set Up:

  • My Repeating Group sorts by a position field (numeric).
  • The DragableRG element is configured with sorting enabled.
  • When an item is moved, my workflow:
  1. Uses “A Dragable RG Item Moved” as the trigger.
  2. Runs “Make changes to a list of things” to update the position field based on “This DragableRG’s New Sort Of Item”.
  3. Refreshes the repeating group.

The Issue:
-The updated position values are incorrect after dragging and dropping.

  • Sometimes, it assigns decimal values (e.g., 1.5) instead of properly reordering as 1, 2, 3, 4, etc.
  • The plugin doesn’t seem to be automatically reindexing the list sequentially.

I’ve attached several screenshots showing my data structure, plugin settings, workflow configuration, and the issue in action.

Could you clarify the correct approach for syncing the database’s position field after reordering items? Should I be handling this differently within Bubble?

Thanks in advance for your help! :blush:






Hi @michael.victor02,

Thank you for reaching out! :blush:

Based on the screenshots you provided, it seems that the plugin itself is working as expected when reordering items within the RG. The indexing behavior you’re seeing (e.g., “1.5”) is part of the plugin’s internal logic—it’s a math expression used in the code to handle the sorting process.


If you’d like to adjust how the indexing is displayed for your specific use case, a good workaround would be to use the “Current Cell’s Index” instead. This approach should work perfectly fine and avoid the intermediate values you’re currently seeing.


image

I’d also recommend reviewing our test page to compare setups:
Drag + Drop Test Page.

Let me know if this helps or if you need further assistance.

Looking forward to resolving this for you! :pray:

Best regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Amazing. That worked perfectly. Thanks so much.

Hi @michael.victor02,

I’m thrilled to hear everything is running smoothly now! :raised_hands: It’s always a pleasure to help, and we truly appreciate having you as part of our community.

If you’ve been enjoying our plugins, we’d love to hear your thoughts! Your feedback not only makes our day but also helps others in the Bubble community discover the best tools for their projects.

Leaving a quick 5-star review takes just a minute and makes a world of difference. Simply head to the Plugins tab in the Bubble editor, search for the plugin, and rate it! :star2:

Want to help even more? Share your experience on:
:link: Zeroqode Reviews
:link: G2
:link: Clutch
:link: Trustpilot

Your support means everything to us and helps us continue building awesome products for you! :rocket:

Thanks a ton, and have an amazing week ahead! :pray:

Regards,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3