Add specific number of records to database for Calendar

I have an athlete training app I’m working on and coaches are able to create training plans for athletes. Each plan consists of 1.N workouts the athlete must do. I have to then create records in a training calendar table for an athlete.

How would I do the following:

  • Specify a workout must occur N times/week for X number of weeks. So, if user specifies, training once a week for 4 weeks, I would need to create 4 records in the training calendar.
  • I may need to specify that certain days of the weeks must be entered for a training event.

So, I have a “recurring” feature I need to add to a calendar table. Currently, I’m using the FullCalenar plugin and have setup my training_calendar with a start_time and end_time. And, it works nicely to show events on the calendar when I specify exactly the date / time with a DateTime picker.

But, now I need to more advanced scheduling and not sure where to start looking for my Workflow code. I don’t see an obvious way to use some type of iteration operation in a workflow that would “Use Input X’s value” and “Run this action” type setup…

My thought is I would probably need to capture recurring / frequency value in a simple numeric input to get the number of weeks the workout must be followed. And, I would have checkboxes I suppose to specify which days of the week the workout must occur upon.

Thanks!