Error saving a dictionary

Actually what is your ultimate aim? Saving values in tinydb, then recalling it in different manner then without editing or adding anything want to save in different format it seems. Am I understand it in wrong manner?

My aim is a working backup system for TinyDB. So you should be able to export all data from the TinyDB and import it later on another device and use everything as usual. In the pictures you can see my solution for this. The data export and import works. There is still a problem:

If a list was saved in the TinyDB and this is imported again, the list will be destroyed and can no longer be used. I then tried to implement Taifunā€™s tip with CSV, but that didnā€™t work either.

I think you get that issue, because you are using the for each key with value in dictionary loopā€¦

Try to use the for each item in list loop together with the TinyDB tags, inside the loop use the TimyDB.GerValue method for each item (which is a tag) to get the value for each tag

As already mentioned earlier, it would be simpler to use the extensionā€¦

Taifun

Iā€™ll try it.

The extension doesnā€™t work. No CSV or Json is generated. The extension is obsolete. In addition, you get a Java error when reading the file. The extension needs to be updated. Thatā€™s why I tried without.

unfortunately you never provided any screenshots while using the extension
my guess is, tthe error is in your blocksā€¦
additionally you also could post the aia file here in this thread, so someone could checkā€¦

there actually is no need to generate CSV or JSONā€¦ the purpose of a TInyDB backup file is to store it in a safe place and later to import it again

Taifun

Here are the blocks with extension:

Nothing is saved in the file and it cannot be read either because the following error occurs:

I now have a working end result, your tip helped. Here the result:

1 Like

Sorry itā€™s not in english I hope itā€™s not a problem.

Ok, this looks like a reasonable bug report for @juananton1991

Great! :+1:

Taifun

1 Like

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