is it possible to create multiple things - of the same Type - in a workflow? i want the number of things to be created to be based on user input
yes, you need to do it with an API workflow on a list. Search the forums and you will find plenty of examples.
Similar problem: I want to pass an integer to my API workflow, which then creates that number of things. Can someone suggest an approach? thanks
Hey @altfeder. You can simply create a recursive api workflow structure. See the demo below:
Here is how the backend API looks like (check the red circled configurations):
And you create a new thing in this API workflow:
And you call the API workflow again (but this time you decrease count by 1):
And the front-end is obvious. It takes the number in the input field and calls the API workflow:
Here is the editor if you want to check the details: Tests for Forum 13 | Bubble Editor
Generating a list of numbers equal to the number of things you want to create and Schedule API workflow on List of Numbers will be more performant + less WU intensive
Thanks @hergin for taking the time to lay it out for me.
Thanks @georgecollier for your suggestion.
Really appreciate it!
Could you elaborate more? How would I create a list of numbers from an inputs value?
Use ‘Calculate random string’ and set the length of the string to the number of numbers you want to generate.
Calculate random string:extract with regex (use expression \d). This will return a list of numbers equal to the length of the string
Like so? When I run this it gives me an error saying that bubble cannot complete the request and when looking in debugger, the regex is not extracting anything.
Length of characters = (number of numbers to generate)
Check the ‘use numbers’ checkbox.
Hmmm, what’s the result of ‘Calculate RandomString’?
Hmmm, try checking this editor that shows an example:
If I enter 30 as the number of numbers to generate, then I will be able to schedule API workflow on a list of 30 numbers. If each API workflow Creates a new thing, and I want to create 50 things, I could specify the length to generate as 50, then schedule API workflow on List of numbers to run that workflow 50 times.
Check you don’t have any spaces before/after your regex expression too.