Services Plugins FAQs

Drag & Drop to Reorder RG saving to database with action

Hi Team,

Think I’m not understanding how to correctly save a reordered RG with an action (clicking a button). I’ve followed the steps in the documentation (I think the screen shot in " Use case 2. Saving to the database with action" is incorrect?), using “Sync of sorting with DB” and have it set up exactly as it is in the demo page. However, on click the order reverts to how it was. I note that this is also the behaviour in the demo app (ie. reordering the RG on the left and then clicking the arrows shifts the reorderable RG to match the “result”, rather than the “result” RG updating to the reordered value.)

Could you please clarify how to save the new order through an action?

Thanks

Hi @hedley ,

Thanks for reaching out! :pray:

It seems like the issue might be with how the new order is synced with the database after the reorder happens. Here’s what could be going on and how to fix it:

  1. Ensure the Database is Updated
    The “Sync of sorting with DB” action is there to help with this, but it looks like the updated order might not be getting saved. When you reorder the items, you’ll need to make sure the order field in the database is updated after the drag-and-drop action. If the order isn’t saved, the RG will reset to its initial state.
  2. Button Workflow to Save the Order
    After the reorder, you need a separate workflow action that updates the database with the new order. This will ensure that the database reflects the new positions, and the list stays sorted correctly when you click the button.
  3. Refreshing the Repeating Group
    Once the order is saved, don’t forget to refresh the repeating group to make sure the new order is shown to the user. If the RG isn’t refreshed, it won’t reflect the changes even if the database is updated.
  4. Double-Check the Workflow
    It sounds like the workflow might not be fully linked up. Make sure that your button is correctly triggering the update to the database with the new order. Without that step, the order in the RG won’t save as expected.

It might also help to check out the demo again to see the flow in action, but once you have everything synced and the refresh in place, the updated order should stay put.

If you still need help or have any questions as you go through these steps, feel free to share your workflow setup or a quick Loom video, and I can take a closer look.

Hope this clears things up!

Regards,

Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3

Thanks for replying, Mina. Here’s a Loom video of my setup.

I followed the docs here: Drag & Drop to Reorder RG for “Use case 2. Saving to the database with action.” and looked at the setup in the demo app.

Thanks

Hi @hedley,

Thanks for sharing the Loom video! That helps a lot in understanding your setup.

From what I see, it looks like the issue is that the new order isn’t being properly saved to the database before the RG refreshes. Even though the UI updates visually when dragging items, the actual sorting needs to be committed to the database to persist after a page refresh or action trigger.

Here’s what you can do to ensure the new order is saved correctly:

:one: Ensure Each Item’s Order Field Updates in the DB

  • After dragging and dropping, the workflow should update each item’s sorting field (position index) in the database.
  • Use the “Sync of sorting with DB” action before refreshing the RG to commit the changes.

:two: Make Sure the Workflow Runs in the Correct Order

  • The button click should trigger:
    • Step 1: “Sync of sorting with DB” to save the new order.
    • Step 2: Refresh the RG to display the updated order.
  • If Step 2 runs before Step 1, the RG will reload the old order from the DB, which might explain why it reverts back.

:three: Double-Check the Database Structure

  • Ensure that the database field storing the order (e.g., Order_Index) is number-based and updates correctly for each item.
  • You can debug by displaying the order field in a text element inside the RG to confirm if the numbers update as expected.

:four: Test Without the RG Refresh (for Debugging)

  • Try running the “Sync of sorting with DB” action without refreshing the RG to see if the new order actually saves.
  • Then, manually refresh the page and check if the order persists.
  • If it doesn’t, the issue is likely with how the sorting data is being stored, not the refresh.

You can also cross-check the setup with the demo app here to see if there are any differences:
:point_right: Demo Page

Additionally please note that we provide general support related to plugin issues and bug fixes, so if there’s a technical issue with the plugin itself, feel free to report it, and we’ll be happy to investigate!

Looking forward to your reply :pray:

Best,
Support Team
Browse all Zeroqode Plugins for Bubble
Banner_Last3