Using TinyDB to Automatically Save and Create Data To Make A List In MIT App Inventor

When using TinyDB, it saves data to the app. I want to save the data and have it automatically create a list on another screen. Is this possible? If so, what should I do?

Can you please elaborate the type of data you want to save? That might help us to give you a possible solution. You can attach screenshots if possible.

If you want to save a list and get it on the another screen you may do like this:
1) Create the list (This you can do on your own):
For eg :arrow_right:image
2) Save the List
For eg :arrow_right: image

NOTE: There is only one data store per app. Even if you have multiple TinyDB components, they will use the same data store. To get the effect of separate stores, use different keys. Also each app has its own data store. You cannot use TinyDB to pass data between two different apps on the phone, although you can use TinyDB to shares data between the different screens of a multi-screen app. (From Documentation).

3) Make another Tiny DB on another screen

4) Then use the tag to retrieve the list on another screen.

For EG :arrow_right:

Try this out and if it works please mark it as solution!

1 Like

I will try to do this, but I want to save people's profiles they create and create a sort of search bar using that data on another screen for the extra information. Is that possible?

Yes I think it is possible I think in the same way but you need to create an dictionary and then add items with the values to it. :slightly_smiling_face:

I'm so sorry to ask this, but as a first time user, would you mind showing me some pictures of the correct blocks to install to create this?

  1. Why do you need another screen for this? You can do this on one screen with arrangements as virtual screens.
  2. Is the requirement that you create a list for a person, with multiple values, then you want to select a person from a list and show their details (the other items in the their list?

Here a simple one screen example using tinydb and lists




The data I want to save is information to create a profile. So name, gender, age, school, and other fun facts about themselves.

If you don't want to use dictionaries, you could create 3 TinyDB Namespaces in the Designer:
using the NameSpace attributes of each TinyDB instance ('Age', 'Gender', 'School',...) in the Designer.

Use the Name as the tag in each TinyDB instance.
The TinyDB GetTags block will give you a list of the Names.

P.S. This would make it harder to search later, compared to keeping it all in one dictionary.