Adding user input continuously to a list

Hello, I’m new to App Inventor and this forum, so I apologize in advance if I’m posting this in the wrong place.

I am trying to make a simple reminder app in which the user can add their courses/classes. Once the user enters their courses they are returned to a “My Courses” page where their courses are shown in a listview.

I’ve managed to set up the pages, TinyDB (to carry the information over both pages), etc, but what I’m having trouble with is saving the user input (course names) to a list. At the moment when I test my app, I can only save one item. If I try adding a second then the first one is replaced.

This is my current block set up:

List

Please help!

Thanks

  • Ty

It is because CourseNames is not initialized as a List but as a String (text).

But why start a List for every TextBox entry? Make CourseNames a Global List. Your Save Button can Add a course to that List, then save the whole list to TinyDb, then Update the List View.

You will need to offer a way to delete a Course Name too.

Rather than the User typing-in a course name, it would be better if they could simply select from a List of courses. This would help to avoid mistakes and make your App more efficient to use.

Thank you for your reply!

How do I initialize CourseNames as a list? This is clearly where I need to start in correcting my mistakes :laughing:

The reasons why this input needs to be a list is, this is were the user inputs their courses so the information can be carried across the app. I do have delete and update buttons planned, but I need to figure this bit out first :sweat_smile:

I also think I have a problem in block I’ve made to retrieve and show the list on the other page, so if (in
my fiddling) I get it right, I can’t actually see it.

Like this:
Global Lists

When saving the List to TinyDb, it will be a single TinyDb Item, under a single Tag, which you can recover directly to a ListView.