Having issues in storing data to another screen using TinyDB

I'm currently working on an MIT App Inventor project where I need to save user scores and display them in a ListView on another screen. However, I'm facing an issue where the scores get overwritten each time I add a new score, instead of being appended to the existing list.


Before adding something to the list, first read it from TinyDB
And for lists, set the socket valueIfTagNotThere to a create empty list instead of an empty text block

Taifun

Hello,
I don't think this helps or maybe I'm not doing something right?

what is the difference between prevScore and nameDB?
Read nameDB before adding something to nameList

unknown

Taifun

These are the changes that I have made but still no use


  1. this is redundant and can be removed
  2. use the close screen block, see also here how to switch screens correctly
    App Inventor Tutorials and Examples: Manager Screen | Pura Vida Apps

Taifun

  1. not required
  2. set global nameList to ...
  3. use the normal open another screen block
    you already have the nameList in TinyDB, just read it from there in the other screen
  4. use only one TinyDB with different tags
    the namespace of that TinyDB should be the same for all screens, for example TinyDB1
  5. again switch screens corectly and use the close screen block here

Taifun

A post was split to a new topic: How to sort a list of lists by the second column?