Help with list +tinydb

Hello, I have created a list and used it with tiny dB so what does this list does
basically, it just saves numbers in the list a lot of them, so I need help with summing up
the list
I want every number that in the list to be summed and show it on labels
the labels are called "0"
this the code for the list and tiny dB that I have created

thank you

something like this?

what does this code do?

See here how you can total a list, using the list blocks provided:

The code in Initialize is generating a list from 1 to 100, and storing it in TinyDB (to have a list of numbers for the example). The code in the Button.Click is recovering the numbers list stored in tinyDB and adding all the numbers (and displaying the result in label2).

yes but its displaying 5050


That is what I have understood you want:


this is a fitness tracker it records your calories burn while walking and when

click save progress it adds the number like
and I want to sum up these numbers and show it on a label

Are you able to see in the example how to add all the numbers of a list?

No :smiley:

and now?

the code u gave only works to sum up the number 0.45 and 1.5 and 26?

What I sharing with you are examples to show you how you can add the numbers from a list. I have not your code. I have not your list.

Try to understand what my code does and to use it in your code.

You can see I'm using a "for each item in list" block, to go through the list of numbers, element by element, and so I add them.

Do something like that in your code....with your list.

I'm sorry but I'm new to the list and tinydb and the app overall
teeest.aia (4.7 MB)
can you help me further?

what list of numbers do you want to add?

You have here the code:

but if the list you want to add is the list stored under the tag "calories", red from tinyDB the tag "calories" (instead of "numbers" from my example)

I've tried it as you can see but when I click text for button7 it doesn't sum up the 2
numbers in the list and show them at the label

But you have changed the tag "numbers" by "calories", haven't you? Maybe you have not stored the numbers in tinyDB? Check what do you have in the tag "calories" in tinyDB.

yes i think

the tag "CALORIES" is not the same than the tag "calories"

yes it finally worked thank you so much but i want to display it on 3 labels how am i going to show it?