Forum Academy Marketplace Showcase Pricing Features

How to create a Thing, multiple times?

Is there any way for a seat to represent multiple seats? Have a quantity attached to it, charge accordingly, and assign to the administrator. Each administrator makes a 2nd assignment to a school user and completes seat info (dates) as needed?

I’m saying this without knowing anything beyond your description, but maybe instead of each seat representing a unique purchase, a unique purchase can represent single or multiple seats - and the entries created in your database are actually purchases.

Maybe?


Gaby | Coaching Bubble

That’s actually what I want to have done. I want to have one purchase equal “some number” of seats. What I can’t figure out is how to make Bubble create “some number” of seats in one action. When the user clicks the “Give Andrew Money” button, I want to charge them “some number of seats” times our price, then have that number of open seats available to the school.

1 Like

Right, what I meant was avoiding creating seats as a data entry, and instead storing seat availability inside a single purchase entry. Purchased quantity is given to the school(s) as their limit. It could hold number fields like “seats available” and “seats taken.” When a school takes a seat, the count in those fields change.

Give Andrew Money > creates 1 purchase

Andrew’s Purchase

  • Quantity = 50 seats
  • Cost = $500
  • Seats Available = 50
  • Seats Taken = 0
  • Assigned Users = list of school users who can “take” a seat

Again, there might be other factors in play that I’m not aware of, but I’m wondering if you can work with the seat data without having each seat be a separate entry.


Gaby | Coaching Bubble

I see what you’re saying now. I started down this path early on and changed my mind. Why did I change my mind? Hmm…

I’m going to take 10 minutes to think while listening to brain.fm about why I stopped this path. Thanks for your input! I’ll post back in a bit :slight_smile:

2 Likes

I remember! Schools need to be able to purchase licenses at different times, and we wanted to be able to track when each license would be up for renewal. Also, a teacher quits in the middle of the year… We want to know which license was assigned to that teacher (when it expires, mainly) so we can show the school what licenses they still have available.

Also worth mentioning, teachers do not need to belong to a school to have access to our system, they can have access as an individual. So Mr John’s signs up, THEN his school decides to adopt. Mr John now needs to be associated with a license from that school.

It all gets complicated quickly, and the seat model felt like an elegant way of solving the problem

Ah, I see. Yeah, there are a few more layers there. Even so, I feel like you can create a different cross-referencing system to avoid the “create multiple entries” on a single workflow. I mean, I’ve run into this a few different times too and since it’s not directly supported, I’ve had to workaround it… I wanted to do a bulk upload feature where each file was a different entry in the DB, and I just told the client we needed to cap it because I was creating an action for every new entry and could only do so many. But, this would be less practical in your case.


Gaby | Coaching Bubble

1 Like

I would agree with Gaby, you don’t seem to need the “Seat” things created at that time, you can create them “on demand” when someone asks for a seat. So check there are seats left, create an empty one, reduce seats left by 1.

However… it is perfectly possible to create x things.

Set up a table that has a single field, number, and create entries from 1 to 100.

Then run an Scheduled API that creates the seat on the list that is a search for numbers from 1 to x.

4 Likes

Thanks @NigelG! Two thoughts: I hadn’t considered your option of creating the seat at the time of assigning, then subtracting 1 from the pool. That was the part of @romanmg suggestion that didn’t register with my brain. Thanks for filling that in!

Other thought is that I’m not as familiar with how to use the scheduled API on a list of things yet. Need to play more there. Thanks you two!

I have Events to which Groups of Users can book seats (0-9). The Users can be part of many Groups and attend many Events. So the number of seats for each event needs to be in a separate Data Type (LinkUserEvent).

I then create entries in LinkUserEvent when the users for the first time clicks a button (More) to book seats.

Have a look at:
https://petertest.bubbleapps.io/version-test/selectevent

Maybe this can be done more efficiently - it’s a bit slow to load and update. :blush:

Has there been any movement on the ability to create a Thing, multiple times? After scouring the forums, the solution has always pointed to Schedule a List API or just “redo” how you handle your data. However, as I have read, it appears that there is no clear cut simple way to do this. Not to mention, if you have a lower plan, your option for scheduling is significantly limited… I’m on a personal plan and scheduling is pretty much a non-option (

Hoping someone has a solution! Especially with the new pricing/structure that happened recently.

3 Likes

Schedule an API on a list is the way to do it, usually.

You just need a “list” in the first place. Which can just be a table of numbers from 1 to X … And you limit the list to the number you want.

100% agreed Nigel - However, if Schedule a List API is not an option, like my Personal plan, there must be another way to tackle this issue. I tried the “Recurring” API workflow… But alas, same issue. Personal plans are “monthly” runs.

Since late 2015, this has been in the forum in some shape or another. Hopefully soon there will be a solution other than jumping substantially higher in price for a basic looping feature like Schedule a List API - Which itself isn’t a great solution from what I’ve read.

2 Likes

I also need this. My use case is that I’m building a checkout experience that allows a user to add multiple items (between 14 and 20 usually) to their cart. I’ve got everything working okay to let them add items one at a time so that’s fine. But from the users perspective, I have people who don’t want to add those 20 items one at a time (it’s a week’s worth of food that they’re pre ordering through our site). So I need to give them a button that let’s them bulk add the “Chef’s Choice” recommended 20 items for them and their family to eat this week.

My response in 2017 was flawed as I didn’t understand how to use “Schedule a List API”. Without going into too many details right now, this functionality absolutely exists and I probably should have amended my post - I’m on a personal plan and have the ability to create a thing multiple times and have been using it for months now.

In short:

  1. The 20 items for your “Chef’s Choice” need to be put into a list (maybe you could do a Custom State, Type Text, Check the “This has multiple entries”).
  2. Then, Schedule a Workflow on a List action. The list to work on is the Custom State you created in Step 1.
  3. You’ll then go to “API Workflows” in your pages menu.
  4. Inside of there, go to General -> New API endpoint.
  5. In that new API endpoint, this is where you do your database magic - Adding the “thing” to your database.

Once run, the “Schedule a Workflow on a List” will take your Chef’s Choice list and for each one, run the actions inside of your API Endpoint which will include your database call to create a Thing. It will do that for all 20 of the items and then stop.

The fun part, as anyone will tell you, is how to let the user know the scheduler is running and creating your database items. I’ll let smarter folks take that one as it’s all over these forums.

Hope that helps.!

6 Likes

In other places it seems folks have let you know about how you can go about creating multiple items. But it seems like you could streamline this process a bit by rethinking how the “Chef’s Choice” works.

Clearly you have some sort of product/SKU datatype right (I’m going to call it SKU)? So, instead of thinking of “Chef’s Choice” as a concept, shouldn’t that be a SKU itself?

But it would be a SKU that is a “bundle”. So you might consider adding to your SKU datatype a boolean for “Bundle”. A SKU with bundle set to true would have a list on it of type (whatever type goes in your shopping cart - I’m gonna call them Order Items, OK?). Let’s call that field “Bundled Items” - again, it’s a list of type Order Item.

So, when you define a bundle SKU, you put prototype Order Items into that list. (Whatever it is that’s supposed to wind up in the cart, you make those items and put them in that list as part of the definition of this month’s or this week’s or just the current Chef’s Choice product.)

Then, the user just shops for Chef’s Choice like they do anything else. And you just add it to their shopping cart like any other product. Obviously, you need to make a small modification to your add to cart workflow(s):

If the added SKU’s Bundle is yes, that tells us there is a prototype list of Order Items that also should go in the shopping cart. Since we now have a list of those things right on the SKU, we can do action COPY A LIST OF THINGS (what type? Order Items. What list? SKU’s Bundled Items).

Now that workflow step holds a copy of 20 (or however many) shiny new Order Items that have been created. These have brand new unique IDs, etc. (Copy is like create new, but it makes a list of things. Hooray!)

Now, of course there are probably customizations that you need to do to these items. Let us say that your Order Item has a field on it for the Order itself or something. Obviously the “prototype” Order Items you stored on the Chef’s Choice SKU wouldn’t have these yet. But that’s no problem, because we can:

MAKE CHANGES TO LIST OF THINGS (What type? Order Items. What List? Results of the COPY step.) Change whatever fields you need to change.

NOW you have a list of Order Items that’s exactly like the User had manually added them to their cart. Nifty. This list is stored as the results of the Make Changes step.

Finally, we must take this list of Order Items and actually add it to the Shopping Cart or Order or whatever it is you are building.

Take that list and just “add list” to the Shopping cart’s list of Order Items. (That would be a Make Changes to a thing step. The Cart has a list of Order Items on it presumably. When you select that list as the filed to modify, you’ll see you have all these list-wise options instead of just “=”. The one you want is “add list” (that takes a list of things and adds it to an existing list).

Proceed with the rest of your workflow as normal.

1 Like

BTW, the various advantages of this are obvious: All of this can be done without explicit recursion (listwise actions like I’m talking about use recursion, but it’s built in and you don’t have to manage it yourself). Also, now you know from the orders that the customer selected Chef’s Choice (How many people use Chef’s Choice? Well, just do a search for orders that include that SKU right?) You could offer discounted prices on the Chef’s Choice items easily (because they could have custom SKUs themselves on them). Etc., etc., etc.

1 Like

That’s awesome! Thank you so much for taking the time to write that out @keith! I really appreciate it! Going to try now.

1 Like

Note that I made a bunch of assumptions about how your current flow works, but based on what I’m describing you should be able to make this idea work regardless.

1 Like

I’m dealing with this problem right now. I know I can solve it using a Backend Workflow but it would be nice if Bubble added this functionality in the future.

The original post in this thread is very old. If you really need an iterative workflow, you can use my List Shifter plugin for that.

Recap of how to iterate using List Shifter:

1 Like