Help with database set up and creating a specific form

Hi there,

I’m creating a workout app where users can create their own workouts from a set of ‘Moves’ from different areas (e.g. legs, backs, arms) and save them. In my database, I have:

  • The move/areas relationship a many-to-one - so that each Move is available to one area to one Area (e.g. sit-ups to abs)
  • The areas/custom workouts relationship a many-to-many - so that different custom workouts created by various users can have many areas targetted
  • The custom workout/user relationship a many to one - so that each user can save multiple custom workouts but each custom workout only belongs to one user

A couple of questions:

  1. Is this the correct logic?
  2. How best should I display this on the app?
  3. The next stage would be to add a filter at the beginning asking people how long they have to work out, then select the area they want to exercise before allowing them to select a certain number of moves according to the time each move takes and how long they said they could work out for. How do you think it best to do this?

Any help is greatly appreciated, thank you!

Hey Pippa,

1 your logic sounds good, quite straightforward
Quick question tho, are you the one creating all the moves? and then users can only select them or people can also create their moves?

2 you could have the following sheets:

  • areas
  • moves, that references the area for each move
  • workouts, that is “row-ownered
  • workout_moves, that maps moves and workout

to create a workout, a user would enter a form screen that fetches email as hidden field (needed for row owner column) and enter the workout name and duration for example
then in the workout screen one could have another button to add moves that sends to a form with a choice component on areas
below the area choice component, I would have 1 choice component for each area (you can use the same moves datasource for all these choice components but use the filter for each to only show the moves for one area), i.e.
lets say you have core, legs, arms as areas
You would have 1 choice that lists the areas and 3 choices that list moves that you filter manually by area
then you change the visibility of the ‘moves’ choices based on the value of the ‘areas’ choice.

hope that makes sense

  1. if you are only looking at preventing from adding more moves once the total time is consumed, you probably look at rollup field inside your workouts data sheet to sum up the durations of all the moves from the workout, compare with the entered workout time (compute remaining time using math column) and decide to allow showing the button or not
    this total duration field could also be used in the form to filter moves that are shorter than the computed remaining time.

Hope this gives you some pointers
Cheers

1 Like

Hi @XceL,

Thanks for your speedy reply! Yes, I am the one creating the moves. The ideal workflow is:

  • User chooses time available (20, 40, 60 mins)

  • User chooses type of workout (e.g. endurance, mobility, strength etc)

  • User chooses body focus (e.g. upper body, lower body, core etc.)

  • We then display a list of moves the user can choose from. Here it would be great to be able to add rules, e.g. Strength 20 mins = 6 moves x 2, Strength 40 mins = 8 moves x 3, Strength 60 mins = 9 moves x 4

I think I understand your explanation although I’m struggling with getting the relations to work. Would you mind explaining this a bit more? And what relation would you use on the “workout_moves, that maps moves and workout” sheet?

I’m also not sure how to allow users to see the details of the moves so they can decide whether to add them to the workout from a choice list. Could I use an inline list instead? And how can I filter by the the previously selected time/focus/type? Sorry for all the questions, I’m pretty sure once I’ve structured the database correctly I’ll be able to figure the rest out!

Thanks so much in advance,

Pippa

Hi @XceL,

Thanks for your speedy reply! I unfortunately still can’t get it to work. The ideal workflow is:

  • User chooses time available (20, 40, 60 mins)
  • User chooses type of workout (e.g. endurance, mobility, strength etc)
  • User chooses body focus (e.g. upper body, lower body, core etc.)
  • We then display a list of moves the user can choose from. Here it would be great to be able to add rules, e.g. Strength 20 mins = 6 moves x 2, Strength 40 mins = 8 moves x 3, Strength 60 mins = 9 moves x 4

I think I understand the first part of your message but am struggling with the second, particularly getting the relations to work. How would you set up your database for the above?

I’m also not sure how to allow users to see the details of the moves whilst they’re choosing from a list so they can decide whether to add them to the workout. Could I use an inline list? Sorry for all the questions, I’m pretty sure once I’ve structured the database correctly I’ll be able to figure the rest out!

Thanks so much in advance!

Pippa

Hey @Pippa_Stevens

Your description changes the structure a bit… I would:

  • Create workout types, times and body focus as columns in a unique sheet that i would call lists/metadata
  • then for your form screen:

as choices components

  • for:
  • I dont know any other way than the choice component that would allow you to filter moves based on the previous inputs
  • I am also not sure what you mean by the x2 x3 and x4 but since you have a max number of moves you could have lets say 9 columns in the workout sheet and show/hide the number of inputs needed based on the previous inputs
  • What you could do tho is to add an inline list in the form below the choice component that would preview moves as cards (has the most available fields to showcase information)
  • This inline list would be filtered with the value of the selected move from the choice component

Again, thats how I would do :slight_smile: not sure there is a better way

Hi @Pippa_Stevens,

Have you figured this one out yet?

From what I see above, my impression is you want the following:

  1. A large list of workouts You have created that are small and specific to a part of the body, lets call them workout “blocks”
  2. You want the user to make a few selections (time, type, body focus) and have the above list filter down to the workout blocks that qualify for type and body focus and use the time for total time of the workout they are going to create
  3. You want the users to then be able to select multiple workout blocks and “save” them as a workout, lets called these groups of workout blocks workout “groups” while also not going over their chosen time previously selected
  4. You want users to be able to see all the details of the workout blocks prior to adding them to the workout groups
  5. You want users to be able to select multiple of each block inside each group
  6. You want to restrict the additions of blocks to a group once the allotted time is reached

If all of the above sounds right please let me know and I will type out a solution, as I believe I already have a recipe/shopping list app that does almost all of the above to a degree (I would rather confirm my understanding before responding at length)

I look forward to hearing back! :slight_smile:

3 Likes

Hi @Cmstewart42

That’s exactly it! Thank you so much that would be amazing! Also happy to jump on a call if it’s easier for you?

Thanks again!

1 Like