Dynamically duplicate x Rows in a table based on criteria

I’m creating a workout app where I’d like to give the coach a 1 click option to duplicate an entire week’s worth of workouts for a specific client. he can then modify the week as needed. The tricky part is that the number of rows to duplicate depends. The backend is connected to Google sheets.

So for example: let’s say a client has 5 rows of workouts for week 1. I want to duplicate values in columns A, B, and C + increment the value in the “Week #” column by 1. The output would be the same 5 rows of workouts with the value in the Week # column all being 2.

There’s no native way to accomplish this in Glide, but I was suggested to use something like Zapier or Make to “make” it happen.

Any insights from the community on this would be much appreciated!

Why do you need to duplicate those rows? Is there any other information stored in those rows that would change week-to-week?

If the goal is to simply duplicate the week exactly, you don’t need to duplicate rows, you just need to duplicate relations
CleanShot 2023-06-10 at 12.52.30

Here I have 2 tables:
Workouts just has your “unique workouts”

And weeks


Which has a list of workouts for that week.

Week numbering can also be automatic, I’m just being lazy here :crazy_face: But check this post

1 Like

So the repetitions, weight, and or # of sets of a movement may change on a week to week basis. The coach would change these fields after the initial duplication if needed, so I want to give that functionality to him

I think this can be applied here.

1 Like