Submenu Changes, are Changing Other Submenu - Help

I am trying to nest menus within each other to like this:

Program → Week_n → Work Day_n → Exercise List (For Corresponding Day) → Exercise Details (For Corrasponging Exercise).

Now I got it working, for week 1, but then when I update it to pull the correct data for week 2, it changes week 1’s source. Whenever I change the source of the page that lists Workout Days 1-3, it changes them all.

Here is the glide app if you want to look at its: https://close-cat-9127.glideapp.io/

Any help on what I am doing wrong?

Few things:

In your Program tab, you have the list set to only show 1 item. Not sure if that’s intentional or not.

Second, your relation should be a multiple relation.

Third, once you have the relation set up correctly, then when you click on a week, you will end up on the details screen for that row in the Program sheet. The inline list on that screen should be sourced from the relation.

Hello Jeff,

I left the list Relational Week like that because I was not using it. I am new to using the Relational system here and after failing to get it to work I configured the app back to the way that was closest to having it work.

If I pull the Relational week as demonstrated I would have a full list of workouts for the week. Skipping over the Week selection menu entirely, and pulling all of the day selections into a single week large set (not really ideal).

With Images this is the flow I am aiming to get working:

We start on the Program Tab:

By clicking into the Program we are given a list of Weeks (since this is an 8-week course, we have 8 weeks)

For each week that we work out we, only workout for three days. So we go to Google Sheet table a pull an array of the correct workouts.

This Part works great and I get the correct workouts, in part because each week has been separated out and the array can only pull workouts associated with one element i.e workout day.

I problem comes with that when I go back and click into say week 8 and change its source to “Week 8 -Day” then Week 1-7 will also start pulling from “Week 8 - Days”. My guess is this is because the week’s list is just a static text field, but as I said I am new to the relational fields and could not get it to work after two days of trying. :frowning:

Thank you for help continuing help :slight_smile:

OK, before we get too in depth here. Can I ask why you have so many tables splitting everything up. For one, I think the way your data is configured is going to make things much more complicated, plus it won’t scale very well. If you have separate tables that serve the same function, but with different data, then that will get you into trouble. I think your main problem is that you are trying to switch up data sources for lists when in reality, once everything is configured correctly, you should have the same source table for all weeks.

Now that I’ve covered that, can you explain in more detail how your data is currently structured? Here’s how I’m understanding it so far.

  • First you have your Program sheet, which is the main driver for your tab. No problem there.
  • On the details screen for that program sheet row, you have an inline list that is sourced from the Weeks List table. Clicking on a week will bring you to the details screen on for the row in the Weeks List table. Following so far.
  • Now here is where my understanding gets lost and where I think you begin to run into problems. Currently, you are sourcing the list from a specific table for a specific week. When you go to the next week list item, you end up overwriting the list source for all list items.
    • Side note. Detail screen layouts are typically attached to the table itself. While you can independently control the layouts between list items, I wouldn’t recommend it in this case.
  • Also, I’m a little thrown off by your lists being restricted to 3 rows. I get the days part, but if the list is only supposed to show 3 rows of data (one for each day), then why do you have more than 3 rows of data? It’s probably irrelevant for now, but something to bring up later.

At this point, I would start to join your separate Week-Day tables into one table and join your separate Week tables into one table. There is no reason to keep them separate. It’s more work to have them separate than it is to work with single tables.

Now maybe you intended to join them all into a single table and already did with your Week-Details table. It seems like you are on the right track, along with your new column relation. But before we go any further, I want to make sure both of us understand which tables should be used, and which tables can be joined together. I can make assumptions, but I could be wrong. Should it just be the Program Sheet, Weeks List, and Workout-Details, or do the other table need to come into play? If so, then they should be condensed down first.

3 Likes

I have it separated that way because I could not figure out how to get data in an array that was made up of only exercises from week_n and workout day_n. If I made up an array of week 1 exercises, I would get 3 days of exercises (no good), If I made an array of Workout days I would exercise from throughout the 8 weeks (again no good). It was my way of slicing the data so I would only get the exercises I wanted. Not great but I hoped it would work.

After finding that the way I tried would not work, I realized that there was probably a better way, but could not figure it out how to get relational fields to work I came here.

  • Yup that’s about where I got lost too :sweat_smile:. Though as you are saying this that I realized I was thinking about how glide works wrong and that I need change the information on the row so that each week has the correct data in it.
    —Note I just tried that and got a litter further but I still need to figure out how to make a relational Day’s page.

  • The list being restricted to 3 was me playing around trying dozen different methods, and that was probably number 12 that I forgot to undo.

  • All of the information for the Weeks tables is in the workout Details table, I broke it apart after fumbling around.

Alright, it feels like we are going in the right direction.

The Program sheet, now has the program name, Array of weeks, and the Relational column to move it down the submenu.

The Week List is still where I think I am having issues, I can’t get it to display a list of days that contain the corresponding exercises.

OK, I’ll play around with this tonight. Without looking, off the top of my head, I’m guessing you just need a couple of template columns that join a couple of columns together…and then you can create your relation off of those template columns. I grabbed a fresh copy of your app and I’ll take a look now that I have a better understanding of your data structure.

1 Like

Quick question:
I see you use arraylists to create your relations. Nothing wrong with that, but I’m wondering if that’s the best way, or maybe I still don’t understand the reason.

First, you have an arraylist linking the Program sheet to the Weeks sheet. To me it seems like you could completely eliminate that and just use the program name in both sheets to create the relation.

Second, you also have an arraylist linking the Weeks sheet to the Details sheet. To me, it seems like you could just use the week columns in both sheets as the foundation of your relation.

I’m wondering if you are using these arraylists as a way to hide or show different weeks or different details.

I’d like to take a little bit of creative freedom in restructuring some things, but I want to make sure I’m not completing going against how you want it to work. I’m thinking about getting rid of the arraylists altogether if they aren’t necessary.

1 Like

I just went ahead with some creative liberty and set it up how I think it should be set up. I removed the arraylists, and shuffled around some columns. The biggest change was to use templates to build the relations.

I’m not sure if it’s exactly how you want it, but I think it should give you a pretty good structure to build off of. Let me know if you have questions.

2 Likes

@Jeff_Hager, you are an incredible human; thank you so much for all your help! This works perfectly! This will let me now build out the rest of the features in the app perfectly. :grin:

One question though. I understand what your temps are causing to happen, but I don’t quite understand how. Like what are the P-W, P-W-D doing. I understand that they are the Program, Week, and Day but where are P’s, W’s, and D’s to begin with?

I have never used templates and will read about them right after I post this, but I would appreciate it if you could explain specifically for here. That way can use this same method in future apps.

1 Like

I used arraylists because I saw someone make a similar app and that was how they did it, so I adapted their method to here. No real strong reason is other than that what knew how to make. Any insights as to when to use or not use arraylists?

That makes sense to me… in hindsight.

Nope, I am just very new at this and only know a limited number of techniques.

1 Like

You can learn about template columns here:

All I did was create a template of how I want the value in the column to look. I used P, W, and D because I’m lazy and didn’t want to spell them out. :wink: Then, as you see in the template column configuration, I’m replacing each letter with the respective column value. If I didn’t set up any replacement values, then the template column would simply kick out P-W-D as the result. Instead each letter gets replaced with a column value in the same row.

As for array lists, they have many uses. You can use them for relations, like you did, you can create image carrousels, you can join multiple arrays together, or add individual items to arrays, and many other things. The more you use glide, the more you will understand how powerful they can be. The only reason I asked (and part of the reason I also asked about your limiting to 3 list items), was because I considered the possibility that maybe you had several possible workouts for each day in a particular week (let’s say 10 workouts), and maybe you wanted to select only 3 of them to show. Then I could have understood your intention for using an array list as a possible way for you to pick and choose which 3 of those 10 workouts would display in the app for that particular day. Nothing wrong with the method, but probably harder to scale since you would have to go into the builder to change the array list. Using templates, it’s just a simpler setup and easier to scale, since you only have to add or remove rows in each table whenever you need to make changes.

Glad it’s working out for you. Good luck with your app!

3 Likes