Delete/Replace a item in a list (modify)

Hi all,
I don’t understand the handling of lists.
I created a value on my page:
image

I added a few items/records to that list.
Now I want to change (or delete) modify a special position in that list (item #3).
How to achieve this? If I use “…item#…”, I’m not able to remove or clear the item at position #3 . Or I want to change the value on this position.
How to do this?

Thanks,
jupxi

Hmm :thinking: I think when using a state, you should still be able to do ‘minus item’. Does that work?

okay… but I have this state (list) and want to store different “user answers”. The user steps through the application. if the user want to edit a already set answer (user navigates some steps back and switches another answer), I want to replace the item on a exact position in the list. If the user wants to choose another answer on step 3, then I want to replace the #3 item in the list with another string.

Ok, let me see if I can give you an example. That seems complicated. :blush: Challenge accepted!

user_answers[3].value = ‘blablabla…’

user_answers[3].remove (??!)

:wink:

Yeah, let me give an example for you. I will work on it now. :blush:

Here you go:

Does this help? :blush:

Editor: testApp42wCleanDB | Bubble Editor
Preview: https://testapp42wcleandb.bubbleapps.io/version-test/delete_replace_a_item_in_a_list__modify_?debug_mode=true

1 Like

Thanks. But no - doesn’t help.

Place a button outside the repeating group. behind the click (worklow), I want to modify the 3rd element of the list.

So like a button that says I want to change item #3?

Like this?

Yes. How to do this?

1 Like

Same link here has the example: Delete/Replace a item in a list (modify) - #7 by J805

Hope that helps. :blush:

Okay. Hard to do this in Bubble. Seems like a workaround :slight_smile:

What Happens If 2 Strings in the List stores the exact same value?

If it is a duplicate, you would have to do it a different way. Sometimes, it is more about adjusting your UI/UX, your database structure, or the way you are using data on the page than trying to make a lengthy work around. You might need to save the values into the database as one option so then each record is unique. Just one option. I am sure there are many ways to do what you are trying to do. :blush: Hope that helps a bit.

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