Can anyone help me with my List?

Hello!

I'm trying to make a Shoe store app and right now I have a working Cart (Uses TinyDB). I want to be able to get the Total Price of all the items from my list which is in Index 10. But i don't know how to get all the items in the list and then filter it to only show the Total Price. Is there anyway to make it so that whenever i press the "update" or "add" button, It gets the total price from all items on the list and adds them together?

Then it will automatically set the label "TOTALPRICENUMBER" to the Total Price

Heres my Blocks:

Here's my Aia file
TINYDBLIST4.aia (4.8 KB)

Thankyou for anyone who can help me!

4b2d06ef1ae41ce941a14d061635cca0495fdc08_2_690x370

I notice in your blocks that you use two different TinyDB tags for your Cart:

  • OrderNo
  • Order No

Do you see the difference?

Considering that the value you store there is a list of items and quantities for a single Cart, consider instead using 'Cart' for your tag.

Also, your global variable List should also be renamed for clarity to describe its purpose, to hold all the items in the current Cart. I would call it CartItems to hint that it's a list, and that it holds the items in this Cart.

Here is a value procedure you can use to pull column 10 from your cart:

Here is another value procedure you can use to take the sum of the resulting list:

Value procedures are nice because you can send the output of one procedure directly into the input of another procedure.

P.S. These blocks can be dragged directly into your Blocks Editor workspace.

See A way to group projects by theme - #10 by ABG
for a demo.