yes, the data is structured to make reading easier
This will work, as long as you do not have any commas in an item (e.g. , "Wed,23,Aug",
)
Alternative to follow....
So many choices, like a kid in a sweet shop!!
The takeaway here is that one cannot programmatically write a list to a single cell in a spreadsheet, but a single datum only.
Thanks for all the input fellers. I have a lot to ponder through and experiment with.
Yes you can, just don't send it in the way we have been doing so far.
so, I can write an array to a cell, just not an embedded array? an array within an array?
Google Sheets would treat it as a string (stringified JSON array) so if you wanted to use it as a list / array you would need to parse it back into a list/JSON array.
It's like making a necktie from rope.
You can, but should you?
like a hangman...
In retrospect, Tim, after these enlightening details, I do NOT want to write an array to a cell. When it comes time to pull the data, it is far easier to manipulation as a flat list, as opposed to unflattening and sorting through the details.
After all, the compilation of the lists at inception, is just to collate final end-user data.
I need some assistance with the JsonTxtDecode segment, Tim. Why is it there, to what advantage, and what exactly is it doing?
In my examples, the data initially comes through as a string (a stringified JSON array, to give it its correct term). The JSONTextDecode block parses the string into a JSON array / AI2 list, making it possible to work with it, as a list, in AppInventor.
This is json:
{"key1:"value1,"key2":"value2}
This is a JSON array:
["dog","cat","pig"]
Jason is a busy boy...
JSON.org is a rabbit hole, eh? I shall spend some time there to gleen a better understanding of Jason. (didn't he wear a mask, and carry a machete, or am I getting confused...?!?)
So after all that reading, experimenting, rewriting, recoding, head scratching, nail biting, it is just that the sheet is empty. I trapped the error 'No data found' and slipped in a WriteColumn (not AddColumn) to just write it in the first column... and it works, not with a list embedded in a list, but it worked. No data manipulation beyond flattening, no textizing and reversing no mumbo jumbo.
I just need to have a header column, and make sure it does not get erased....
You need to get back on topic Charley....
Topic being that whilst writing a column to a sheet I would get No Data found error.... I was just trying to say that I figured out that Adding and Writing a column differ, and that I had to have an existing column to be able to Add another. Despite there being bugs in the works still, and a further, deeper understanding of JSON required, I'll try to figure it out.
Thanks anyway
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.