I have a database list of exercises and workouts. They have a many-to-many relationship.
When I create a workout and add multiple exercises to that workout, I would like to display the list of exercises for that workout in the order in which I added the exercises. Currently it automatically sorts it alphabetically (or reverse alphabetically).
Is there a way this can be changed to sort based on when which exercise was added first? Thanks in advance!
I know I can sort that exercise list within the workout alphabetically, by creation date (of the exercise list), and upload date (of the exercise list)…but I don’t know how to sort by any other manual way, for example if I wanted the workout list order to be:
2- Bench Press
3- Tricep Dip
Does anyone know if this is achievable or if there is a workaround? Thanks!
I think there is no way to sort it based on the user added way with relationships. But you could achieve this with creating another collection to store the exercises of that workout and sorting that list as Created Date- Oldest to Newest.
Made a quick clonable app :
And made a video too :
Jason ( @jasondupree ) made a wonderful Workout app and that app has this sorting and I think he also did the same way or maybe a different way!
@TrZd I did this with a “join table” collection. For a basic version of this, there’s 3 collections:
You don’t want to link exercises directly to workouts. Instead, link exercises to workout exercises, and workout exercises are linked to the workout. The workout exercise holds the data, like the order, sets, reps, rest, etc.