Hi Bubble Experts
I am creating a function to update the content in a repeating group. However, whenever I update an item, the updated item appears at the bottom of the list. This happens because I remove the original item and add the new content to the end of the list.
Is there a way to maintain the original order of the items in the list after updating an item? I pasted the bubble editor below and see if anyone can give me some ideas to fix this issue.
Instead of add, and remove that was there previously, I’ve used the set list command. Now the idea behind this:
Example: you have a list with 1,2,3
I get the list of texts and merged them together, and form a single string, merged with |||. So now, it’s 1 ||| 2 ||| 3
I do a find and replace. Find the current text you’re updating and update it with the text in the input. If you’re updating 1 to 4 4 ||| 2 ||| 3
Split by ||| so that it becomes a list again
I hope this approach makes sense. Also, you might face an issue in case duplicates are stored in the list since it’ll find and replace all instances of the text. So you can store the timestamp as well along with each text and just show the text, and not the timestamp with it.