Hello! It seems creating several things is a bit tricky in bubble.io. I need help as I am currently unaware of how to move forward with these. Just a point in the right direction, please.
I have a field that shows a number, like an order quantity. The things (number of things) are created depending on the quantity stated in that number field. I have read toolbox, API workflow, but I am still confused and would like to understand which is the best way forward for my use case.
The Simplest way to do this is by running an API workflow on a list of things.
Simply create an API workflow that creates 1 thing.
Then run that workflow on a list.
That can be any arbitrary list, of anything, with a count equal to the number entered in the input.
The simplest way to do it is using the Toolbox List of Numbers element.
Add the element on the page. Set the start number to 1, its increment to 1, and its length to the value of your number input.
Then, just schedule your API workflow to run on that list of numbers.
There are alternative ways (such as using a recursive workflow, which will be slower and more costly in WU, or using the data API which will be faster and less costly in WU), but for simplicity, I’d use the method outlined above.
@adamhholmes So this should run on element - ListofNumbers A - right?
But the element ListofNumbers A (“Toolbox”), could not be found. I can only find the quantity input in which I connected the toolbox element.
Additionally, what should be in the API Workflow field, and the scheduled date?
Yes, it shoudl run on the ListofNumbers A’s List
But the element ListofNumbers A (“Toolbox”), could not be found.
It should be there on the list.
But there’s a persistant bug with Bubble in recent months, where things like this don’t always appear… so a workarounf id to create the expression somewhere else first, then copy and paste it.
If that doens’t work, then maybe your List of number Element is inside a RG? In which case that changes everything.
Additionally, what should be in the API Workflow field, and the scheduled date?
In the API workflow field you need to select the API workflow that you want to run.
And the date is the Date you want the workflow to run (which, presumably is NOW… i.e. Current Date/Time).
@adamhholmes Hello Adam! Can this be done using customs states instaed of toolbox?
I was able to do that in another function, but using RGs and parent group data. Since the toolbox the scheduled API cannot find the list/toolbox element, I was wondering if this can successfully be implemented using customs state.
or perhaps there are other smarter ways to do this?
I’m not really sure what you mean?.. The toolbox plugin is just used to generate a list of numbers.
Sure… you can use any list…
It’s just simpler and cheaper to use a list of numbers than to be pulling things from the database.
You can also use an arbitrary text, split into individual texts… but still the List of numbers form the toolbox plugin is the simplest way to create a list, in my opinion.
Thanks @adamhholmes for your detailled description, it really helped me forward.
Nevertheless I’m still struggling with this one.
My situation is slightly different (simple description, totally something else):
I’m modifying a “cart” with this “work on a list backend workflow” where I want to add certain “products”, these products are also things.
So in the cart database, I should end up with a list of products, based upon the number of products that are chosen from a dropdown.
This dropdown value is stored in a ListofNumbers as suggested and I’ve a backend workflow on a list running on the ListofNumbers for adding the product to the cart.
Where does it go wrong?
The product is added, but it’s only occurring 1 time if I choose any number. So if I pick 5 from the dropdown, it’s only added 1 time to the product list of the cart.
If I’m looking at the loggings, I see the action being started and ended 5 times, so you would expect that this goes well.
I don’t get it…
I can add several products in the App data of the cart by hand, so no issue here.