Hi community members,
Yes, here I am again with a question.
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 ( ), 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.
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.
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 )
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
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.
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.
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
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.
@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?
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.
Thanks for the sample.
Maybe a dumb question, in the first screen, in the components, you have used an Inline List 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?