Problem with "for each item in list" block

Hello there,
I´m pretty new to this so pls don´t judge. I would like to build an App in which a Soccer Coach can keep a list of dictionairies of his players and some of there attributes. So i created an Interface where the coach can insert his infos. But everytime i run the app theres a problem, which states that the list of pairs is not well formed together with a piction of all the data in the variable.
Can anyone help?

1 Like

use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps
see also Live Development, Testing, and Debugging Tools
Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

1 Like

Hello, I have a similar problem. The Do it function does not work for me, because it is only showing a RuntimeError because of a not well formed list. In my case I create a list and in this list I create different dictionaries. For each dictionary I save one person and on another screen I need to access these informations via tinydb. This is working fine but as soon as I want to extract values from the dictionary it say that the list is not well formed. And this appeards for every dictionary block. Somehow im not able to access the values in the dictionary that are put into a list in the tinydb. Do I maybe have to create a new dictionary on the second screen?
Thank you in advance.
Sincerly

Then the Do it function is working, but you have a problem with your blocks/data somewhere.

Show your relevant blocks and data

1 Like

Is Spieler a dictionary or a list?

Also on first run of the app, TinyDB is empty and you will not be able to select an item from an empty list

Taifun

1 Like

image
It is a list of dictionaries.

1 Like

The do it funktion finds the error in the "for each item in list block".
Screenshot 2024-01-20 172635

1 Like

you are again confused about lists and dictionaries...
if Spieler is a list, it can't be a dictionary...
better to rename Spieler to listSpieler to avoid confusion...
show us a Do it result of global Spieler and let us know, what you are trying to do
Unbenannt

see here for lists

see here for dictionaries

Taifun

I´ve tried like everything... :slight_smile: