I was using the Local DB for the first time today for a simple “enter and then graph” data app (two fields), and I quickly discovered that (at this point in time) it isn’t possible to add rows to the Local DB.
I thought a simple work around would be adding “dummy rows” and then manually keeping track of where the real last row is by way of a stored local variable. I did put values (non blank) within the dummy rows.
While this strategy worked fine during any individual usage of the app (e.g. I can add a few rows, view a graph and see the new rows, add a few more, see the additional rows on the graph, etc.) the changes to the Local DB made using the SetCell method do not appear to be persistent beyond a single app session. Specifically, if I get out of the app and restart it, the Local DB changes I’ve made using SetCell are lost.
The Local DB.SetCell method also never appear within the “Click here to edit spreadsheet” design view, including while I’m using the app. I do however know the Local DB data is being changed by the SetCell method, as I pull data from the Local DB as a separate operation in order to graph it.
Is there some sort of Local DB property I may have missed that would enable persistence?
I should add here that I’m using an iOS phone platform, and that I know from practice that stored local variables are persistent across app usage (for example, the aforementioned actual last row of data variable).
Thanks in advance for any help you may be able to offer!
apologies for not thinking to add a link to the project file, here it is:
Very thorough explanation of your issue, and presentation of your app. You are a great example of getting help here.
I am going to try to recreate the stickiness issue you presented, however I will be doing it on android, and only from companion.
I will paste my text blocks. It might not be for another 20 minutes or so till I get to start on it. Screaming kids right now
I confirm that modifications are not sticky, and I confirmed this on android, in companion/live mode with the following blocks.
Thank you for your kind words and confirmation of what I’d experienced.
What’s the next step now, is there a process for bug reporting that I should follow or is this venue sufficient to get in front of the development team?
@domhnallohanlon Can you please make sure this gets on the bug list please?
I signed up to the forum precisely for this issue. Thanks folks for the excellent writeup.
At a minimum @domhnallohanlon is it possible to revise documentation to clearly state that you can’t persist data between sessions?
SetCell is not working i think. Not creating new row (I mean new one create row)You can see listview 5 button.
I have a LocalDB in my project can be edited by the use. The problem is whenever the user closes the app the database resets. How do I make the contents of the database stored on the phones local storage.
What are the blocks you are using. The LocalDB is persistent unless you are deleting the app and reinstalling.
- User enters value in a text box
- Clicks Button
- Values are saved in local db
- Column 1 is displayed in a list view on a separate page
First picture is List view Page and second is form user fills out
As you can see i tried to do some stuff with local storage but it cant seem to work
Please see the topic: Local DB - persistence of data values using the Local DB.SetCell method
I experienced this problem as well. I could make changes (and view the changes) to the LocalDB during an app session but the changes were not persistant between sessions. I reported this as a bug (github) and had a reply that this functionality is on the ToDo list.
Will the recent update resolve this? I saw “Local DB” in the Release notes. I assume it is about this?
I still have the same problema, reset the “Local DB”, does anyone know how to solve the problem?
Same problem for me too. Any ETA to fix?
I would use Local DB for my app but i read that there are some problems, how do You think to fix?
Also I saw that there is AddRow and SetCell to update value, but there is not DeleteRow I think is fundamental to manage a Database
You are correct, but because of the confusion with the name Local DB, it is not a database, but just a data table.
SQLite is a database, but Thunkable X has no support for this.
Anybody knows if this bug with LocalDB persistence is fixed? And if not, is it being fixed?
I have confirmed the data are still not persistent in Local DB with the AddRow function as well.
@domhnallohanlon, was this classified as a bug?
Local DB - it is incorrect name of the component that can not save data between sessions. A more appropriate name for this component - Table.
Thanks for the clarification.
But if the component could be (optionally) connected to the Local Storage component, that would be a very nice component!