Getting my thoughts clear

Hi Gliders,
I just want to get my thoughts clear/straight and I hope you can help me with it.
Maybe some of you already have some idea, but at the moment I am busy creating my own app for keeping track of all the medication that I am using.
Right now, the most important thing for me is, that I keep track of how many tablets I have of each medication that I am taking.
My idea is, to create a custom action, in which I deduct the number of tablets I am taking at that moment.
Right now I have 4-5 moments per day, that I need to take some tablets.
I just want to keep it simple and first make something that is fixed.
If needed, I always can change the app.
In the action, if I have 5-6 different medications, then for each medication I need to create a rule/action/edit/write/change, so I can deduct the taken tablets from the total.
I hope this is right.
But, is there maybe a quicker, easier, or different way to do it?
Keep in mind, I am using the free plan, and I am still a beginner, when it comes to creating apps in Glide.
There are still many things I need to learn or need to get the hang of it.
First I want to keep it simple, and later on, I want to make the app nicer and more flexible. (But that is something for the future)
In the past several of you already had helped me a lot, and I am very thankful for all the help.
At the moment I am using an app from the app store, but this app has some things I don’t like and it starts to annoy me. So I want to make something myself and start simple and easy.
I hope my question is clear and I hope you can confirm or correct my thoughts.
Many thanks in advance for all your help and tips. :slight_smile:

Do you mean you need a different rule for each medication? Or you simply need to deduct from the total?

If you need to deduct only, then you can create a relation from your logs table back to the medications table using the medication ID, then the on-submit action of your logs form would “increment” the total column by -1.

1 Like

Sorry, i forgot this.
For some medication I take one tablet, for some I need to take two tablets.
Now and then, I also need to add to what I have, because of a new supply I had get.

Then you need an extra number column to hold your “tablets count”.

Next, in the Logs table, add a math column called “deduct tablets” with the formula being: Tablets count * -1.

In your on-submit action, you would use an increment action on the tablets relation, point to the totals column on your tablets table, and the incremental value would be the “deduct tablets” value.

Take an example, Medication A has 10 tablets before you have a new log. You now log a deduction of 3 tablets.

The “deduct tablets” value will be -3, and the increment action would bring your Medication A totals to 7.

When you need to add to what you have, add an edit screen to the Medications table, and simply edit straight on the totals column.

Or, add a button to increment 1/5/10 at a time on a details screen.