Dictionary error "not a well-formed list"

the value is saved as a list of pairs from dictionary
it is retrieved as a list of pairs into a dictionary

nope. It's something like this

If it is a list of pairs, it would be some thing like this:

if it is retrieved as a list, and your trying to converting it to a dictionary,
use dictionaries_alist_to_dict instead of dictionaries_dict_to_alist where the error pops.

1 Like

Export your .aia file and upload it here.
export_and_upload_aia

1 Like

give me a few minutes to clean up some of my debugging and i will post file

cleaning up has resolved the issue, i have an idea why but im now not sure. please feel free to delete this topic. i will delete it if i am able.

thank you guys for helping

It would be more helpful to post where your app went wrong, so others could benefit.

Your dictionary pairs are inside a list, you will need to get the first item of the list (your dictionary) then you can do the list of pairs thing:

list = [{"Name":"ghea"}]
select index 1 from list = {"Name":"ghea"}   << a dictionary

I have not tested whether {"Name":"ghea"} is just a string, and needs encoding to a dictionary

1 Like

Coldstone2.aia (571.1 KB)

it seems that my blocks showing error were working correctly but the blocks where the TinyDB were saved were at issue.

during my debugging i broke the edit procedure into several smaller procedures. i moved them back into the main routine cleaning up but that didnt resolve issue.

the save procedure is where i resolved the issue, and that came from using a key for validating rather than its counterpart text field. the keys are cleared out in my code to prevent orphans. all of this code is reused over with different items in a list so my list of lists of lists of lists is becoming mind boggling

Yes, that's right! (I said this before)

don't delete it, mark post 10 or 8 as the solution

this may be a good point at which ta poll if what im doing is effective to manage my data
to clarify i will use user inputs as entry by the user of the app and not coded in. programmer writes the info that cannot be changed after the build

in this app:
user inputs data for each device(about 50 fields)
user inputs multiple devices into a list

nothing difficult there. i originally put the data into the device1DB and device2DB. issue was all my data is showing in all namesDB, even if you rename the DB it all still pools into a single TinyDB, so if i write all the fields to device1DB if overwrites the data that i saved for device2DB.

renaming or giving unique tags to each of the fields for each of the devices was an option, but that seems to be exactly what the dictionary is for.

The TinyDB NameSpace feature lets you keep different instances of TinyDB, with no worries about tag overlap.

So you could keep a separate TinyDB for each piece of equipment, with its own Namespace.


before and after, i did not change these blocks

having watched the talk : Working with Lists and Dictionaries in App Inventor - YouTube my idea was to keep all the data in memory using keys, but in reality, i never need all the different device info except in the listview to choose which one to focus on.

If you kept a table of input text box components and their tags, you could loop over the table for getting and saving.

See my Wordle keyboard code at

1 Like

Do you anticipate having to search or graph your temperature and pressure readings in the future?

Saving them in Google Sheets would allow multiple workers to add data simultaneously, and open up graphing possibilities:

1 Like

of Corse you didn't change those blocks.
you changed where what to give to TinyDB
and as I said in the fist post,

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.