How do I show a certain column on a certain day?

Hi community members,
Yes, here I am again with a question. :slight_smile:
As maybe some of you know, some time ago I tried to create my own app to keep track of my medication.
Due to illness, I was not able to work on it further. And also I got stuck with, how to create something like this.
Now I am feeling a little bit better and I wanted to give it a try again.
I just removed everything and wanted to start all over again, because I had the feeling I was making it too complicated.
And I hope that this time I will make it more simple.
As a reminder, I am using the free plan.
I created a new Glide table.
In there, I have the columns with the name of the medication.
I also created a column for each day of the week.
Actually, most of my medication is the same for every day.
So I could remove all those columns.
But like everything else in life ( :wink: ), there is one medication that is different on different days of the week.
And this also changes per week.
For example, this week my schedule is 3,3,2,3,3,2 (this is the number of tablets I need to take per day)
Next week it could be 3,2,3,3,3,2,3.
This is why I created the many columns, naming them by the day of the week.
Now the thing is, I only want to show that column In the app, when it is really that day and I don’t want to see the data from the other day columns.
So, on a Sunday, I want to see the data from the Sunday column, on Monday the data from the Monday column, and so on.
I also created one extra column named Day and here it shows the current day.
Not sure if this was needed, but I just created it, just in case.
I tried some things with filters, but it looks like this is not working.
I also have a time column, with the time I need to take this medication.
I created that for later, to show or hide things.
I hope my question is clear and I hope someone can tell me how to do this, and if it is possible or not, and please try to explain it very simply, step by step.
I don’t work that much with Glide that often, so things are sometimes not that simple for me.
Thank you so much for all you help. :slight_smile:

Instead of filters, you need visibility conditions.

  • Create a math column to return the current weekday number: Weekday(Now)
  • Add seven components to display the values in each of your 7 columns
  • Set a separate visibility condition on each one:
    – When weekday equals 1
    – When weekday equals 2
    – etc, up to 7

There are more elegant ways to do all this, but the above should get you out of trouble for now.

4 Likes

Here’s something that might work for you (Darren is your guy if you want something really elegant, but I tried this and it worked so thought I might as well post it).

Have a column for the days needed, where Sunday = 1 etc. Split this column so that you can use it in a relation. Use a Format Date column to return the current day. Use a math column with WEEKDAY(date) to convert the Format Date column to a number. Use a Relation to link the Split to the Math column.

Then in the app you can add a Collection and filter by the relation.

edit - reading Darren’s post you can skip the format date column and just get the day number from a Maths column! :yum:.

1 Like

I think Darren’s idea will work for me.
But to make it clear how it looks right now, this is a screenshot of the table right now;


In the day columns, are the number of tables that I need to take on that day, for that medication in the name column. (the number behind the name, is the number of tablets I have left, in stock/inventory)
As you see, the first medication has different tablets on different days.
The rest of the medication is every day the same.
(The one that has no tablets is a spray and I use it when needed, so that one is easy :wink:)

Once I get this sorted, then I need to create custom actions to deduct the number of tablets from the stock.
But that is something for later :slight_smile:

Gosh I never even considered the number of tablets, only which ones are taken each day. Your first post was pretty clear about that as well :upside_down_face:

1 Like

Just adding a spin on @Darren_Murphy’s idea. Instead of creating 7 components, create IF columns in your table with 7 conditions. So each IF column should return values only for the current day. Then change your components to use those IF columns. Should be a little cleaner on the front end to maintain.

3 Likes

Looks like a better way not to store initial data in this way, because it will much more difficult to show in app.
I suggest creating each medication for each weekday, also even and odd weeks independent row.
Then it very easy to show and filtering. Also, you can create data grid to see all data in this way which is better to see overall. I think.

1 Like

And for now, you can use New table (preview mode) in which is very easy to show and directly edit all data and have a looks like original.

1 Like

Do you mean, for that one medication, create 7 rows? One row per day of the week.
For all the other medication, just one row, because that is the same every day.
I thought that maybe one row for that one medication and then use 7 columns would be the way.
But maybe you are also on to something.
I can try to duplicate the “app” and try your thoughts and see how that looks and works.
Thanks :slight_smile:

As I mentioned, everything is welcome, and the more ideas I get, there should be at least one or two that will work for me. :slight_smile:

no, i suggest one row for each

I did not hear or know about New Table (preview mode)?
No idea what this is or how it works.


Ok, i will prepare simple example for you

You mean that at the end, I will have 11 times 7 rows?
Because I have something like 11 different medication

Yes


Each row each column can address edit button action to separate row. So, it will be easy to edit and manage.

1 Like

@Darren_Murphy ,
Is there also a way to set Sunday as day 7?
Now Sunday is set as day 1
Or do I need to add maybe something like a IF/THEN column and reassign the day numbers?

Tab-DUAL WEEk/Medication tracker · Glide
https://www.vidline.com/share/V0WRHD5MWE/16585636737f79ed199893a779e0ee21

This one just to show how to configure interface to cheking and editing schedule data

1 Like

In your case, would the day number matter that much, as long as you know 1 equals Sunday and you set your conditions accordingly? Day number would only be used to determine which column of data you are showing.

1 Like

You are right🙂
But to me, it feels and looks a bit more organized.
I just need to get used to it🙂

1 Like

Thanks for the sample.
Maybe a dumb question, in the first screen, in the components, you have used an Inline List component;
inline_component
If I look in my components, I don’t see this component. Also if I use the search option, it does not show anything.
I only see the List component.
How to get this Inline List component?

Or, how can I configure or set the columns like you did on the right side of the screen?