I want to store data in TinyDB and display it as a list

I want to create a birthday reminder app. On the homescreen, there is an Add Birthday button, on pressing which will ask you Name, Date (via Date Picker, and Phone number (via Contact Picker). I want to store all these data (no matter how many times I add them) in tinyDB and once added, it should be displayed as a list. Like a table.

just do it and if you have specific questions, let us know and add a screenshot of your relevant blocks

you might want to use the following extesion to display the table

A very good way to learn App Inventor or Kodular is to read the free Inventor’s Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps … the links are at the bottom of the Web page. The book ‘teaches’ users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials Our Tutorials! to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun

Here’s what I did so far. Clueless about next step (I am a novice when it comes to coding. Just know a bit of HTML and CSS nothing else.)

learn to work with lists

and do the tutorials to learn the basics

Taifun

What I want to do is, display the stored data as a table or list. How do I retrieve the data from TinyDB. And, would you mind going through the screenshot I attached and tell me if there’s any error.

your blocks will work for 1 birthday only

for several birthdays use a list to store a birthday (i.e. a name, date and phone number) and store that sublist as item in a main list
That main list you store in TinyDB in only 1 tag

Taifun

if you want to add multiple birthdays then use add items to the list block

Please tell me what I am doing wrong. The entered values are not displaying once I hit the Save button.

Hi Kunnathur,

Please initialize listMain as an empty list, then set its values in the saveButton.Click event, before calling Tiny_DB1.StoreValue.

Also, make sure to use ListView1.Elements, not ListView1.ElementFromString.

ElementsFromString expects values separated by commas
for example, red,blue,green will be converted into a list of three items.

GetEntries creates a dictionary where each entry is composed of a key (Tiny_DB tag name) and a value (the stored value associated with that tag).
However, this is not what you’re trying to achieve in your current setup.

Let me know if this helps.

1 Like

(post deleted by author)

This is what I have done so far. Whenever the app starts, I want to show already added entries. And once the save button is pressed, I want to add the last entry to the end of the list. Seems like this block is not rendering what I want. Appreciate the help.

Good morning Kunnathur,

try this

if you want a formatted text like “textBox || Month Day || phoneNumber”

1 Like

Thanks a lot. It did work.

1 Like