I love the stored/cloud variables-- it something I’ve been pushing for a long time and have talked with Mark about. I think it can be a game changer for beginners and building apps with persistence and shared data.
I started playing around and am having trouble with building a simple noteTaker app. I have defined stored noteList but when I try to insert an element it crashes (well, the op doesn’t work). I tried first setting the stored noteList to empty list, but that didn’t work either.
I played around some more, I think the insert at is not working with stored variables. I was able to create a list with the list block, and its stored persistently, but I can’t add items to the list
Sorry you are having issues but I am glad to hear that I am not the only one having this problem. I can’t seem to modify any list stored in a variable. That includes adding, removing, or modifying any list item.
The two upper purple and orange blocks show the solution. To create more variables please click on the gear-symbol in the upper left of the purple block.
The current issue has to do with the way that we store the new types of variables. We aren’t properly storing modified lists (or objects). We have an imminent release that will fix the issue in the majority of cases and are working on a complete fix that will be rolled out soon after.
How do you initialize, say, a stored variable, to be defined as a list?
One way is to first run the app and set the stored variable to empty list. Then modify the blocks of the app to expect a list in the Screen.Starts.
I’d check to see if the stored variable is a list, but I dont think there is a way to ask if a variable is a list. And I can’t insert things into a variable unless it is a list.
In Thunkable X, you can define the value type of any variable. For the list, use such a block.
An empty list is , an empty object {}, a non-empty object contains { and }, an object in the string representation [object Object], not a number - NaN, etc.
If the brackets can be used inside the values, then the definition condition of the list needs to be clarified - the first character = [ and the last character = ]
Hi Paul. I tried the code attached and can’t get the “notelist=null” to evaluate to true.
I also tried "notelist=“null” because there has been a bug with LocalStorage such that that
would work, but that didn’t work either.