Create tab for detail content

Hi Everyone,

I am building a 14 days nutrition program app and I would like my first tab to show the program for the day.
I have a tab to show the whole program: showing the list of all days, on tap on one day, you can see the detail of the day.
But I would like users to be able to see what today’s program is for them.

My issue here is that I can’t find the way to structure my database and my app to do so.

my Database currently has

  • a program tab with colums for: Day n°, Breakfast meal name (relation column), Lunch meal (relation column), Dinner meal (relation column).
  • a “recipe” tab with columns for Meal name, Details, Day n°

I managed to create a tab showing directly the detail of one day with: the name of the day, and a card for each meal using an inline list from the relation columns. But I don’t know how to make the content change each day … :frowning:

It’s not easy to explain so please let me know if you have any questions

Thanks a lot Deb

1 Like

There are probably multiple ways to fix this. The first that comes to my mind is the following:

  1. First you need a start date on which to support the rest of the calculations, let’s call it DATASTART
  2. Calculate how many days have passed, thanks to a Math column that we will call DAYPASS, from the date of the day (today) to DATASTART
  3. Divide the days by 14 in another Math column using the MOD function (DAYPASS, 14), the result will be a number from 0 to 13
  4. It is not difficult to adjust the diet of the day according to the result obtained.

Let me know if you need more help.

1 Like

Hi @Roldy

Thanks a lot for all of this.
I’ll try out as you said and come back to you if I have any more questions. Thanks a lot for the help! :slight_smile:


1 Like

You’re welcome, let me know if it’s solved

Hi @Roldy
So it’s all done for the first step.

I have just adjusted the calculation for DAYPASS doing = ((DATASTART-now)*-1)+1
So I have a positive number, and it also counts today as Day 1.

I didn’t do step 3, as I need DAYPASS to go over 15 so I can show a specific message when Users have completed the program (I’ll use the visibility function to do so)

Now, I am struggling with step 4.
the info DATASTART and DAYPASS are in my “users” tab.
All the info relative to the program for each day is in the “Program” tab. Each row corresponds to a day (Day 1, Day 2, etc…)
I am not sure how to automatically show the info of the correct row based on the DAYPASS info …

Sorry to ask more of your time but any chance you could detail that step?

thanks a lot!

I could see a solution by creating 14 tab for each of the program day, with their relative content, and set up the Visibility to only show the tab that corresponds to the day …

Is there a way to do it by creating just 1 tab and automatically show the correct content ?

Yes, of course you’ve to choice this scenario, and this too can be done in several ways.
A simple way is this: Assuming that the program is displayed in Detail mode in the tab, you could for example set a filter that selects the current program according to the MyProgramOfTheDay that is in the user’s table.

In Detail:
Options-> Filter-ProgramNumber IS User PRofile> MyProgramOfTheDay

Sorry for my synthetic answers but I’m not in front of my PC, I’ll can help you in more detail at the end of the day if you still need it.

I’m really sorry @Roldy I’m not sure I understood what you meant :stuck_out_tongue:

I actually have different sheet in my googlesheet:

  • Users: with the STARTDATE and DAYPASS
  • Program: with 14 lines, one for each day. Each column is one aspect of the program Breakfast, Lunch, Snack, Dinner.
  • Breakfast recipes: each line is a recipe. On of the column is the day of the program “Day 1”. and I used a relation column to then link it in the program sheet.
1 Like

Ok, i write an example APP for you in minutes…

@Deborahlevyben, here is an example, copy it.
Look at the filter in the My Diet Tab (Options → FILTER)
Obviously it’s just an example that I did quickly, but it should work and the important thing is to understand the logic.

1 Like

Hi @Roldy :slight_smile: Thanks for this really !! it helped me a lot and I think I have found an alternative, but something is not going right … :stuck_out_tongue:

I have 2 sheets:

  • Sheet 1 - the breakfast recipe list: one recipe on each row and each recipe is associated to a day of the program. so I have a number column “Program Day” with the value from 1 to 14.

  • Sheet 2 - Users: the list of the users, with the operation you suggested to calculate the number of days that have passed from the moment the user started the program. So I have a Math column “DAYPASS” with value from 1 to infinite.

So in my app tab “Today”, I created an inline list element, taking the data from the “Breakfast recipe” sheet, and filtered it this way: “Program day equals user>DAYPASS”. But I don’t know why, nothing is showing up … If I changed the filter to “Program day lower than user>DAYPASS” for instance, it works perfectly … I’m not sure why…

Any idea?

Again thanks a lot for you help :slight_smile: :slight_smile: !!

Ok, this happens because the user>DAYPASS value is not found (so it’s a null value, and a null value is always less than your DAYPASS, that’s why the filter works perfectly in that case).

I need a couple of clarifications to better understand your scenario:

  1. Have you tried my APP in your builder? Does it work as you expected? Have you seen that the diet is customized not only according to the program of the day but also to the user who uses the APP?
  2. The Privacy settings for the example APP I sent you are “public with email”, I think these are the most suitable for an application of this type; what kind of privacy have you set in your current APP?

aaaaaah ok, is there a way to make the user>DAYPASS value a “real value” to be read?

To answer your questions :slight_smile:

  • I did try it and it works well :slight_smile: Does that mean that the program can be different for each user? I see that you’ve created an email column, does it mean that I would have to replicate the 14 rows for each user?
  • The privacy will be public :slight_smile:

For this version of the app, the program will be the same for all users they will just be able to choose between Vegetarian or Omnivore

Yes the sample APP is designed for personalized program per user, where the program can be different for each specific real person; this is why the privacy is set to Public with email; so, in that case we can use the email to relate with a specific program for that person.
So, instead in your public scenario we don’t have a real person but a generic Vegetarian or Omnivore unknow user; in this case we can use a Public privacy, but we need to memorize in some way the DayPass and the Type of program for this generic user, we can write this data in User Specific Columns; this type of USC data are written directly into the device of the user, so you can’t have in your spreadsheet.
This was the theory :slightly_smiling_face: … now I am writing you a version of the sample APP for unauthenticated public use. Wait, in a few minutes it comes …

Ok, this is the sample public APP. The approach is different from the previous one because we do not know the user who will use it, therefore we cannot rely on a table of real users.
Look at the filter now in the Today Program Tab, it now takes into account the choice that the generic user has made in the Welcome Tab.

@Roldy Thank you so much for this !!!
I’m having a look at it ! :slight_smile: :slight_smile: :slight_smile:

1 Like

@Roldy THANK YOU SOOOOOO MUCH !!! It is working :slight_smile: !!! (hoping it will not break going further)
Roldy I would be more than happy to give you access to the app for free when it’s ready :slight_smile: as a little thank you for you help :slight_smile: send me an email at if you are interested :slight_smile: Go live scheduled for January :slight_smile:

1 Like

I’m more than happy for you :slightly_smiling_face:
Ok I’ll send you my mail later today.
Please set my post where is the sample as Solution.