Create multiple things with one button press

Hi all,

how can I create multiple things at once when clicking a button? I would like to create several events at once with different dates depending on input. For example “repeat event at 1:00pm 4 times the next few weeks” when the user types in 4 in an input.

In the forum realized that I need an API workflow with this, but on which list would I run this in that case? I thought about creating a list in states but that leads to the identical issue: How to create several states depending on input X by the user?

Best,
Philipp

Just run the workflow recursively 4 times (or however many times the User inputs)… and create each event at whatever interval you like.

Or, you could create a list of dates on the front end and then iterate over that in a recursive workflow on the backend.

2 Likes

Hi Adam,

how can I tell my API workflow to run exactly 4 times? I’m kind of stuck here… The input of the user is basically an event name, date, and then the amount of recurring times.

Then one button is clicked saying “create”

Just pass the 4 into the workflow as a parameter…

Each time you run it, deduct 1, and only re-run it when the number is more than 1.

You’ll need to pass the name and date as well, and each time you reschedule it, modify the date accordingly (based on whatever interval you want between events) - e.g. date plus 7 days

1 Like

I’m sorry that I’m so lost, but where would the list come from in my case that I could iterate through?

You don’t need a list in this case… as I said, just run the workflow however many times is entered by the User…

i.e. if they enter 10, run the workflow 10 times to create 10 events.

1 Like

Hmmm I get that part, but how can I do this dynamically without copy and pasting the workflow 10x? I’m stuck on this “for” loop basically…

To add some visuals to what Adam described, you would have a backend workflow that looks something like this.

The last step of the backend workflow calls the workflow again, and the parameters would look something like this.

Finally, when the button is clicked in the app to create the events, you would run a workflow that calls the backend workflow and sends the appropriate parameters based on the values the user entered.

6 Likes

You guys are heroes! Thank you so much… I wasn’t aware that I could schedule the API workflow in another API workflow, hence the immense confusion.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.