An Incorrect Solution
Your 1st instinct may be to set the variable to an empty list whenever the screen starts. This does not work because the app ends up clearing out the list every time you close and reopen the app. This defeats the purpose of the stored variable.
The Correct Solution
Rather, a better approach is to only set the variable to an empty list IF the list has not yet been defined. This makes the stored variable a list variable IF and ONLY IF the list is not yet defined. Thus it will not clear out any items previously stored in the list.
The Final Code
These are the final blocks that I got to work.
This is really nice; you guys should update the chat tutorial to be a bit more list this; the current tutorial saves the text onto a single string variable so it’s confusing as to how it could actually be used in a real-life scenario…
also, please fix the WebAPI component (at least on iOS) it simply doesn’t send any headers or body
(or maybe I’m doing something wrong and a tutorial using it would help…?)
@Dinto Glad to hear it. I also do not know of a checkbox feature to make complete.
With the current features available, I would suggest having a “To Do” list and a “Completed List”. And when you click on an item in the To Do List, you could choose to delete or move to the Completed List.
in one of my list, the Notitie one, if I want to delete an item, it deletes the item I click on, it deles another one. I can’t find the error, it think it’s a bug…
I am Testing the todo-list with two phone.
When I added an item to a list on one phone, it came up on the other phone. I don’t want to share the todo-list.
Some one who downloads the app have the possibility to make his or her own list.
I’m now storing the variables in the app ( at first seen in your tutorial in the cloud) How can I get this right?
It’s been a few day’s ago, busy:sweat_smile:
Still having problems with the issue above;
I have two list, list one: Notitie and list two: Boodschappen.
When I add items to both list, and delete an item on one list, it deletes the item on that list but when I delete another item from the other list, it doesn’t delete the item I touch but the one under that item…
I’ve delete the screens and start over again because thought it could also be a bug in one of the listviewers, didn’t help.
I’ve also change te code a bit, with local storage instead of the use of stored variable.
Could you give it a try?
I wil send you the project link
I Tried you code, and it did work, for 2 days:
I read that it is a bug…
The notitie screen is working, but de Boodschappen screen is now deleting two items at a time.
Or if I tap two times on an item the whole row with 4 items disappears.
This don’t have to be that difficult?
here is the List_viewer code…
I am trying to save text in a text input box. Any ideas on how to do this? I would like to add a journal feature to my app. So users can add text, save the text and then add more text to the existing text when they reopen the app. I am new to thunkable! Thanks in advance.
I can’t seem to figure out a way to change the firebase path. With the example above, when I save the list I have a “folder” called list in firebase at the root. but I actually want to save it as “folder/list” instead of just “list” (basically have the list in a separate area instead of the root).
Another option is to save your list as a cloud variable, then if you have firebase hooked up, each cloud variable will be a different folder in your firebase database. This is the newly suggested approach. Check out my most recent tutorial that explains this:
Except my problem is nesting one variable in another. So for instance, one stored variable “user” with a cloud variable inside it called “friends” that contains a list. For some reason, I can’t for the life of me get that simple concept to work. I have tried an object and I have tried cloud variables and for some reason I can’t get a proper path to work.
Of course, you can remove an element from a list. This block:
is doing just that. You just need to know which index the item occupies (and for that, the “in list () find first occurrence of ()” function can be used).
Note that this will NOT remove an item from a list stored in a database. For that, you need to
recover the database record using the key, and store it locally in the program (app variable)
remove the redundant element
save the amended list back to the database using the same key, so that the original version will be replaced.