Can someone explain to me why my list is not a list?
its cast into a variable that is initialized as an empty list
i used 2 simple strings for example
i save the list to the variable
the variable is not a list.
ultimately, I'm using more complex strings, but i simplified to this during troubleshooting
edit----- in the solution, i found more of a definition if my question.
what i am working with is a list of [lists and objects]
You are getting a string back from the text of the read File (a stringified JSON array)
You need to convert this back into a list using the JSONDecodeText block from the Web component
You can save AI2 lists to most, if not all of the available databases: tinyDB,tinyWebDB, CloudDB, Firebase, and the data can be returned as an AI2 list. If you save an AI2 list to a file, it will become a string (as you have seen), so when the data is returned you will need to convert it back into an AI2 list.
Google Sheets will directly export data in csv format, with this you need to convert the data to an AI2 list. If you use google apps scripts to interact with a google sheet, it is likely that the data can be sent and returned as stringified JSON arrays, which will need to be converted back into AI2 lists.
When you need to do the conversion will depend on what you are doing with your data. For example, you can display an AI2 list in a label. The label text is a string, the data, as a label text is no longer in a list. However the list will still be in the variable you saved the list to.
In your last image you show a list in json format (includes some values with the curly brackets { }. This data can either be converted to an AI2 list, with just square brackets [ ], or you can convert it to a dictionary and work with dictionary blocks, which are more suited to working with json data.
i think that answers my question even though i havent processed that as an application.
my intent is to make a configuration file that i can copy as a backup and manipulate outside of AI2 if needed.
the necessity to have internet access is a deterrent for google sheets, although i do like the idea of google sheets.
i paid for the extension from Jewel and even though i paid 50 bucks for the "top option" i have not been able to get response from Jewel on how to get started building it into my blocks.
is there a way to see and access TinyDB from outside AI2? is there a way to copy and manipulate TinyDB in that way? also namespaces seems not dependable as my data is sometimes there and sometimes not, or in the wrong namespace. its likely my fault through sloppy work, but thats part of what im trying to achieve using the file. it seems more tangible from this point.
Which extension was that ? ( I see it was probably the Google Sheets one, I just released a free extension that does all this and more for free....)
No, the tinyDb is locked away inside your app, it can only be accessed from within the app itself (Android 11+)
Yes, you can export (and import) the contents of your tinyDB (there are many methods/extensions), but you have to do this (export/import) within your app.
In my experience, tinyDb and namespaces have been totally reliable. Remembering to set the correct namespace is subject to human frailty though
once i figure out the decoding mystery, i think the text file will be reliable and lend itself to outside interaction.
is there ever a need to encode while saving?
do i need to encode parts like dictionary as i save them to a list?
i am now using variables for each piece as a troubleshooting method, but using MAKE A LIST an adding the components seems easier if there isnt a good reason not to.
Depends on what you are saving and where/how you are saving it
When you create a dictionary or a list, you are creating an object. The content of these objects is in the main made transparent by the AI2 blocks, which can cause confusion. If you spent any time working with javascript, objects are quite opaque, unless you handle them correctly.
If you create a dictionary and add data to it (either as a list or json { }, then you are adding data to that dictionary object. If you want to save a dictionary (object) as a list (object) - that AI2 understands, then you will need to use an encoding block to help with this.
I added that block so im confident that my issue isnt there
also ill add that the issue SEEMS to manifest only after i refresh companion. that is, as I dont close the app, the issue isnt created.
i added a global variable to see what the raw text looks like before and after encoding. it seems full before encoding, but the select list item cant accept it.