I have decided to take this as a personal challenge. Please let me know if there are other ways, experienced bubblers.
I guess what @seanc07 suggested can’t be easily done in Bubble because there is no bulk create method for the people you are supposed to create in the UI (without creating them in the DB). However, you can mimic a bulk create by using two custom workflows.
First, about your design: probably you want your People
data type’s name to be Person
and Event
will have a list of Persons
called People
(instead of just one Person).
Now see the demo below:
You can’t assign a list of persons as custom state and add the temporary persons to this custom state. So, I had to store them a custom state of text list combined with comma in my case (but it can be combined with any character. I see you have address too, maybe combine with something more unique). Later, you will split them by the same character.
This is what add person button does:
The custom state is on the button as you see. See what I add to this list: the combination of the text fields of a person with commas in between.
Save Event Button
Then, the save button does this:
-
Create a new event (nothing new):
-
Reset inputs (nothing new).
-
Save this event to the page as a custom state (this is not required, just to show them below in the demo):
-
Schedule a custom workflow (that does the creation of people one by one). I scheduled for 1 second but it can be shorter. I have tested 0.1 second and it works like a charm too:
First Custom Workflow: Create People
Now, let’s see this custom workflow:
-
Create a person in DB. Now, this is the part where you will get the first item in the personlist custom state and split them by comma (or whatever you set) and put to the correct fields of a person.
-
Add this person to the page’s DB event (you can get the created event in other ways like
do a search
for as well if you want):
-
Remove the processed text of name-lastname (in step1 of this workflow) from the personlist custom state:
-
Trigger another custom workflow (Next Call) that calls this one recursively. Bubble doesn’t let you to call this workflow in itself. So, you have to schedule the workflow with some delay. And this call will only happen if there is more persons in the personlist custom state.
Second Custom Workflow: Next Call
This workflow will just call the first one, that’s it (and again, 1 second can be shorter if you want):
Conclusion
I know this sounds a lot but hey, it works
Here is the demo page if you want to investigate the details: