SOLVED: Using Custom States to Add and Remove Data to Database


I’m using custom states to add data to my database - specifically the profile data type. Per the image below, when the user selects the specialties, they turn green. When the user clicks the “Continue” button, the selected specialties are added to the database. This all functions correctly.

My issue is that I would like the user to be able to remove specialties. For example, if they clicked “Continue” and then later realized they made a mistake and clicked the “Back” link, the user would click one of the green specialties, and it would turn white. **However, if the user clicks the “Continue” button again, I would like the selected specialty to be deleted from the database. Right now it’s not deleted and I’m not sure how to do that.

Here’s the link to my editor if that is helpful. Plantain 2 | Bubble Editor

you need to generate 2 different custom state lists

one for is the selections “use” is yes, and one for if the “use” is no.

if a cell is clicked, and its “use” is no, it will add that thing to the add list
if a cell is clicked, and its “use” is yes, it will add that thing to the remove list

1 Like

i think an easier wey to desing this is those specialties are a list you create in an option set. and they have yes/no

when i user clicks the group, it just adds and removes that option set to a “list of specialties” on the user. then it doesnt have to be saved, its just changing when they make hte click, and it will be green if it is in thier “specialty list”

Thanks very much. In theory I get what you’re saying, but can you lay it out a bit more granularly step by step?

can i build a test page in your app? i was starting to do it in mine and send you pictures but it would be better if it was in your app on a test page with test data

Yes that would be great. Here’s the link to my editor: Plantain 2 | Bubble Editor

says user does not have permssion to view data. are you sending me a link to the UI builder?

you may have to do this (click on the image, its small)

Thanks I changed the setting. Pls let me know if you have any trouble accessing it

ok its done. i did it without using yes/no on the option set, and the condition just askes if its on the list or not

that help?

Thank you - yes that’s very helpful and very appreciated. I guess my issue with using a repeating group in this way is the formatting / design. I prefer how I have the “buttons” set up now. Is it possible to take the method you used and apply it to my set up? Trying to figure out the quickest way to get it done.

replace the text in the button with the options sets display, and delete the text field. then the button will act like a group. you can also give clicking on groups the same funtion

changed it, look at it now

Okay I already did a bunch of work creating the elements as text fields in the dietitian-onboarding page. Is there no way to work with what I already have? Apologies if I’m misunderstanding and/or being dense.

i was trying to show you the process of how its done. but ill look at your onboarding page

Thank you

just like i showed you on the test page you can do the same thing, it wont take that much to change it. ill copy past it on that page and you can delete it if you want. you need to learn option sets. having a list of text and adding those texts to the list on the user is going to be very restrictive for you in the future

Thank you. Yes i figured i could do it with option sets and I used them for every other onboarding step, but I was having trouble with the design on this step.

its too much work to change your step 5 design for me to do. but ive created it for you. all you have to do it rename the data type field and add more option sets and change thier names and your good to go. it wont take that much time.

ill end up makeing a change that gets you stuck and you dont know how i got you there and youll be frustrated

Okay makes sense - I will take a look. At first I saw a Group T on the dietitian-onboarding page, which is what I think you created, but i don’t see it now. Did you move it?

i tried to back track the few changes i made, because i was realizing it was a bad idea

looks like your specialties (group 5) is missing, did you delete it? if not just keep backtracking untill it comes back, it should come back.

we should have made a save point before i started working on your page

what im saying is a bad idea is me making all the changes on your actual page. you need to look at the example i created for you on the test page and implement it into your app, if you want. which i recomend you do