Repeating / Standing orders - best way to do?

Hi all,

I’m trying to create an app which will allow the users to give their customers Standing Orders, to repeat like every week.

I’ve tried to make each order a record (with the name of the item ordered, and the date of the first order, as fields), and then upon pressing a ‘confirm’ button, Bubble will automatically create another, I don’t know, fifty records or something with the date field of each to be one week apart (for the next year).

It’s simple enough to program this, but as we know (as I’ve seen from all the forum discussions), to create fifty records in one go on Bubble takes an EXTRAORDINARY amount of time! And then how am I supposed to create ANOTHER fifty or so records at the end of each year for EACH product of EACH customer!

Can anyone recommend a different way to go about this? Remember it’ll need to be that each order has to have its own record for invoicing purposes.

Thanks in advance.

One way you might do this is as follows. Upon creation of the first order, create another one scheduled in a week and an API workflow scheduled in a week to check for any orders scheduled on that day. If there are any, then run the API workflow to do whatever action you need and create a new one with a date a week in the future with the same API workflow scheduled to run again, if the order needs to be repeated.

Depending on your use, a more general or simpler approach might be to schedule a similar API workflow to run once per day to check for any orders that need to be actioned that day. Once it runs on those orders, if it needs to repeat, then also create a repeat of those orders with the appropriate date. This would involve two API workflows: one that is initialized once with maybe the click of a button that starts the cycle of checking every so often, and one that actually does the work of actioning the item and creating a future item if necessary.

In this way, you’re just creating one additional record each time. Also, you should be using API workflows, which are triggered, but you don’t need to wait for them to be done before subsequent actions can take place.


Kevin
AirDev

We’re looking for Bubble developers to join our team: https://jobs.airdev.co/

I like this idea,

BUT Im still on a hobby plan and dont want to update to a paid plan just yet…

Also, is there maybe a way to run lots of workflows at the same time, each workflow only adding one record? Something like that would seem much more efficient, no?

check out this plugin or read through the custom calendar forum thread

You can use this to create a function or workflow so that when the first order is created, the user can select how frequently they want the order placed, or on what day of the week etc.

They can and will also need to set a date range, starting on and ending on what date.

The plugin creates a list of dates that would follow the logic you put into it.

For example Every Monday from Jan 1 to Dec 31 will get a list of dates that is for every monday of that year.

Then what you could do is create a data type that is “saved orders” where you save all the information regarding products etc that they ordered. On that data type have a data field that is a list of dates.

Then you can set up an admin page for the user to go to where they can review/edit all upcoming orders…

You would be able to display in an R.G. the list of dates with corresponding data for the order…then create functionality that they click on the date to edit the order if wished, cancel or “place” order.

If you want it to be placed automatically, you need to upgrade account and get an ability to use API workflows or recurring events.

However, if you want to be on hobby plan, what I mentioned should suffice, although no automatic orders…unless you schedule a custom event when the page is loaded, but that requires expecting that everyday somebody will log in…

I think ultimately for what you want to do, upgrading to a paid plan is necessary

1 Like

Thanks for this, we’ll explained. I’ll have to try and work with what I’ve got.

It’s just a pity that for some reason Bubble just cant save/create more than a few records at the same time in a reasonable speed. Doesn’t really make sense why it’s so hard for Bubble to do.

The performance issue is a real issue, however there have been some plugins created that may help with certain issues like creating a list of things. There are a couple by @gaurav who created BDK plugins that could help speed things up.

These two may be of help.

Yes, seen them on my search, but all these plugins do is dynamically create/edit lists, and for lots of reasons I need to have all the lists & orders all saved on the underlying database.

Oh well a shame for Bubble.