Real weird problem with getting a list of lists from TinyDB

Hi,
I struggle with a list of lists I'm trying to get from a TinyDB. Look:


My list of lists is names "NewListeJuments" and it's gotten from a tinydb and put in a ListeNomsJuments variable.
This list of lists is made from items with 4 items each.
On the right I checked every step with do it : "ListeNomsJuments" is indeed a list (do it = true), with two items, the first item is indeed a list with four items, and the fourth item is correctly retrieved as "active".
But in my code, the companion refuses to execute the test whether the fourth item of the first item of the list is this or that, saying that the "select list item" can't accept the argument. I compiled the app and the blocks also don't run.
The worst is that these blocks are an exact copy / paste of the very same blocks running on another screen of the app without any difficulty at all.

I don't understand :grimacing: : help anyone ?

Post a screenshot of your procedure

image

I'm on the phone, I will in a few minutes but :
It's a text procedure to remove any ", (,[ or other characters .
But anyway, I did a "do it" on the select item before the nettoie procedure and got a red flag too :frowning: so it's not the procedure.
Will show you in a few minutes.

1 Like

And the "nettoie" procedure is also in the other screen where the blocks are running smoothly.

Here is the red flag with the "select item" so before the nettoie procedure


and here is the procedure:

And the bug still coming without the nettoie procedure

Help :frowning:

How are you creating the list in the tinydb tag "NewListeJuments" ?

I am concerned about the display of extra quotes around the list item from "ListeNomsJuments"
image

I am able to replicate the error if I store the data like this:

the list is created on screen 1 by reading a csv file :


I use then the exact same blocks on this first screen and they work ok.
The list can also be edited on another screen this way:

No other idea ?
About the concern wrt extra quotes around the list item, what's weirder ist that those quotes seem to be added by the for each process, or the select item process : look on the right do it tests, the list of lists doesn't feature extra quotes !

That's puzzling and I have the same problem on several places in my app. It looks like a bug, or I may have missed something but what ?

Can you share your original csv file, or an example of it ?

It's really nothing fancy : it's created by the app in another screen, using:


and the .csv file is, opened with notepad:

At first I used a tinyDB to store the data of my app but I want the user to be able to export the data in case of change of phone or whatever. So I switched to .csv files which are much simpler to export / import and so on.
I kept the tinydb in the app to store the data between screens to limit the slowing of the app constantly accessing the .csv files.
But I've had inconsistent troubles like this one for a few weeks now, list of lists that suddenly stop to be understood by the app as list of lists, even if the very same blocks work somewhere else. It's very puzzling.

You will need to track back to the beginning, perhaps cutting out or reducing what could be considered as unnecessary stages, and get a cleaned up workflow that works.

This nettoie procedure, if you work with AI2 lists, is unnecessary, and there is much to-ing and fro-ing from csv file to tinydb to Ai2 list and so on, that could be introducing the error.

Perhaps revisit your other screen, where you say it works, and check that code against the one with the issue.

Worst case, just delete the blocks and start again....you may come up with a better way of doing things?

I revisited the other screen where it works, so much that I simply got rid of the first blocks and copy-pasted them from the working screen.
It didn't help. The blocks are completely identical, the do it procedure says every thing is ok, but it isn't, why ?
I can get rid of the nettoie procedure. But to rewrite the app is a problem : I have more than 600 people using it, and whatever I do, I need the app to be able to use the data already stored in the last version.
So I used a "contains" text test instead of a select item, and for now it works, but it's worrying because that means something isn't rock stable in all this.
At one point, I suspected one of the list extensions I use (to remove duplicates or sort the list) as the culprit. But it still doesn't explain why the blocks sometimes works and sometimes don't ?

Can you go back to a version of your app that was working OK ?

Not with THIS list of lists : it's the last feature I'm adding, so it isn't in the last version play store version
:frowning:

Timai2 you mentioned you were worried by the extra quotes in the faulty select item but I just noticed something else in this bloc :


I had put some red on it without noticing : it's not only an extra quote this select item has, it's a whole comma : before the item, there is a comma, as if select item from list was trying to cope with 3 arguments, one empty at the beginning, then the item, then the "4". Is that normal ?

Anyway, as I hadn't any other idea I decided to get rid of the For each block which the select item didn't like, so had to do it by hand. It's not very beautiful but, with these blocks, no error:

that's not elegant at all. But it works. And without the for / each item, the select item from list gets through it like a charm.
if someone else has a better idea ?

See this project for a TinyDB export/import solution that works with values of 0, 1, or 2 dimensions ...