Runtime Error: The list cannot get item number 2 of list length 1!

See the multiple nested brackets 4 levels deep?

There are plenty cases in your code where you retrieve a list from a TinyDB tag, and immediately wrap it with a Make A List block.

I suspect you were thinking that maybe it would not be a list, and you wanted to be really sure that it would be a list? Well, what it does is wrap the returned list in a new list, with the old list all in item 1. Do it enough, and you turn what should have been a list into an onion.

This particular error message included an onion with a TinyDB component at its rotten core.
I can't see any place in your code where you store a TinyDB component, so it must have happened in the past. I suggest you clear each and every TinyDB instance in your app, include TinyDB1.

You never needed more than one TinyDB for this app.

Keeping vertical slices of what should have been a table under separate tags is a recipe for disaster, risking loss of synchronization between slices, and spreading selection logic across all slices of the table.

I recommend switching to this tag/value system:

Keep the TinyDB1 tags you use for registration and login.

Keep your daily data in one tag per year (2023, 2024,...) for easy cleanup and speed of access.

Under the year tag, keep a table with one row per Home_Screen entry, with the date, time, and 4 textbox numbers (cleaned up with 0 instead of blank.)

You will have to filter and reshape the data to feed your graphs, a necessary tradeoff to achieve stable data storage.

Learn how to work with tables:

Also, you do not switch screens properly:

1 Like