How do you list view data to .csv and the some question?

I got a chance to open your aia, and I see your TinyDB data is doomed to be wiped out every time you open the app.

You initialize variable list (awful name, doesn't say what it's a list of) to empty list on entry to Screen1.

You then try to do a csv text conversion the wrong way on that empty list to fill two global variables (whose names I can't read, but i can match by number and shape of letters.)

You then wipe out whatever you had stored in TinyDB under the tags materials and quantity.

I didn't bother reading further.

For your app, if it meant to be a serious app, use a spreadsheet or an online database, keyed by material name.

If you are just experimenting, use the material name as the TinyDB tag and the corresponding quantity as the value. If there are additional attributes like bar code numbers, add extra TinyDB Namespaces to map between the various attribute pairs (name of bar code, bar code of material name,...)

Do not store individual columns separately, as it will cause coordination problems as items are added and removed. Instead, if you keep tables, keep one material and its quantity as one row, adding rows as you add new materials.