Kindly solve "Adding Duplicate Values in Custom States List". I am Willing to pay

I am working on a local language puzzle game app …& I need to save response in Custom States List.

The problem is I can’t save duplicate values in the list as bubble doesn’t allow duplicates in custom state list. It automatically removes the duplicates.

Bubble forum suggests having a new thing in database for each response to get unique values, which is very painful way.

In my app, I need to get user’s responses (0 to 5) from each repeating group’s cell and save in the custom state list…lastly save to DB.

The RG will have maximum 200 cells…that means i need to collect 200 responses. All response values will be between 0 to 5. So ofcourse there will be duplicate values. How do I save these responses locally? Because writing in DB each time lowers the game performance and user interest.

I also want to modify this list of user’s responses, when user goes back to previous cells of a repeating group and changes his selection.

I spent too much time in finding a way, but I couldn’t solve it. Please help.

If a plugin can potentially solve this I am willing to contribute, If it helps me to save & modify duplicate values in custom state list… because I don’t want to save in database on each & every click.

Thank you in advance.

I think you can solve this problem by using local storage. Bubble uses local storage extensively to enhance the usability of the Bubble platform and make it more user friendly. Local storage can be stored and retrieved through one line of javascript. There are also existing free plugins that will allow you to use local storage.

In this way you don’t have to go to the database and you don’t have to worry about list constraints (of which there is no work-around that allows you have duplicates). I would suggest using the Toolbox plugin to set and retrieve these values via javascript using the lines below:

window.localStorage.setItem(properties.key, properties.value); //JSON.stringify(person))

var result = window.localStorage.getItem(properties.key);

However, if you wanted to write a plugin to use local storage (and for some reason you didn’t want to use one of the free ones already available), it would look something like this:

Local storage will allow you to track game states on the client quickly and then you could save these values to your database using a “save point” in the case you wanted to retain the values in the next game session.


Hey @bubble.trouble many many thanks for such a discriptive explanation. Actually, I am not fully aware about bubble capabilities…and I will explore more about local storages as you suggested.

Hey @bubble.trouble I tried using local storage as you suggested,

  1. Installed Toolbox plugin, named function

  2. Ran your JS code in workflow to save values

  3. Values are getting saved in local storage as intended (index-wise), I am also able to change them index-wise successfully.

  4. Now comes the headache

I couldn’t get those saved values in bubble. I tried calling that test function in run javascript, i tried localstorage.getitem…i also explored information about getting those values in bubble…but i couldn’t. Its day 3, so I decided to ask for help.

I am sure that I was writing wrong syntaxes (I also used the ones you gave in your earlier reply). How can I get that values list in bubble and save to database? Kindly help me with the correct code.
Thank you.


Checkout this video- Loom | Free Screen & Video Recording Software | Loom

Ankur@ Nocodetalks
Looking for a Bubble Coach? Check out here


Thanks brother…that was simple. I am your youtube subsciber and I watch your tutorials, they are great!!

1 Like

@ankur1 nice solution. I actually didn’t realize that Bubble treated custom state lists differently than Data Type lists…great solution!

its not the custom state issue, actually it is “plus item” issue.


@ankur1 oh right! So this is that issue where a list can hold duplicates but when using plus item it doesn’t work properly correct?

I remember looking into this issue previously… has anyone determined if this is a bug or intended behavior? And if so why did they make this decision?


It mentioned into Bubble documentation. Code like this can only be explained by Bubble engineers.

I’ve lost multiple days because of it.


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