Custom State Repeating Group Multiple Database Submissions

OK, this is very new territory for me. I know what I want to happen, have an idea of what I need to use to make it happen, but have no idea how to go about this.

I have a page where I want trainers/leads to be able to register lockers for multiple new employees. The left side will be used to enter the person(s) name(s) and the locker they want to register. Clicking the next button will then send that information over to a repeating group which will then show an entry for what the trainer/lead just entered. The workflow for the Next button should clear the form on the left while creating a new entry in the repeating group. The minus icon will allow the user to remove the entry if they decide they don’t want it anymore. Below is a mock up of what the page will look like.

I do not want a new entry made in the database each time the form is completed in case they change their mind at some point during the registration process. I imagine this will involve the use of custom states with the repeating group. I understand that custom states are used to temporarily save information to the page and then that information can be sent to the database later. However, even after watching several videos about using custom states, I’m still pretty fuzzy on how they work. To me it’s like they’re this ambiguous thing out in the ether that you can’t see or touch, but it exists and is capable of doing some really neat things if you can understand them. Can someone please help me understand what I need to do here? Maybe this is as simple as using the Display Data option to push the data to the repeating group? I just worry how this will work with multiple entries to the database.

Below is how my locker registration data type is set up in Bubble. The primary name is first name listed in the repeating group. The share name is the second name listed. I have it setup like this so that only two names can be registered per locker.

Hi there, @bryan.beneker… long story short, check out @adamhholmes’ response in this thread (good stuff, Adam) to get an understanding of why you will likely want (or in your case, need, I think) to create the entries in the LockerRegistration data type each time the form is completed. I guess there could be a path to doing what you have described by having a handful of custom states that are all lists and then trying to create things in the LockerRegistration data type by parsing the lists to grab the pieces that make up a single registration. But, even if that’s possible (or even if you can do it some other way that I am not familiar with), nothing is going to be as straightforward as creating the thing when the form is completed. If the user changes their mind, they have an easy path to removing a registration (and you can easily delete it from the data type), so if it was me, I would very likely go this route.

Anyway, maybe someone will come along and give you a path to do exactly what you have described (who knows, maybe it’s simple and my brain just ain’t working right tonight), but if not, then I hope this response helps.



Hey @mikeloc ! I just read over @adamhholmes response, and agree with you that this would be needlessly overly complicated. I’m going to take a shot at making things work by creating a new thing in the LockerRegistration data type. I have never sent data from a form directly to a repeating group (showing only that data), so this will be a learning experience. May have questions later…

As always, thank you for your continued help!

Happy to help! Oh, and just a heads up… you won’t have to send data “directly to the repeating group” because it will update automatically to display new locker registrations as they are created, assuming the registrations meet the criteria of the repeating group’s data source (search).

OK, so this might be a bit tricky…

I created a field called ‘Trainer’ which is a yes/no field. When clicking the next button, I have it changing the Trainer field to yes (no by default). This will allow me to tell the repeating group that the information I want is coming from that form. Add a constraint for the status to be ‘In Use’ so that it’s only statuses that would be submitted by the form. To further clarify, I want to add a constraint to say, “Modified date within the last 5 minutes.” How would I express that as a constraint?

Just out of concern… does your phone ding every time someone responds to you on this forum? I’m up at a crazy hour and I want to make sure I didn’t wake you up. If your phone dings, I will make sure I wait for decent hours.

Nah, I get up stupidly early, too, and I haven’t taken my phone off silent for, well, ever.

You mean something like this for the constraints?

That worked! Once again, thank you very much!

Glad to hear I’m not robbing you of rest. I was just surprised to see you responded already and was afraid I dinged your phone and woke you up.

1 Like

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