Hello, I want to back up data from TinyDB and restore it later. The output button outputs all data in the form of a dictionary. The output can then be saved somewhere. If you now re-enter the text in the text field and press the save button, the data from the dictionary should be saved back to the TinyDB. But here comes the error:
The second argument to foreach is not a list. The second argument is: {“Name1”:“Wert1”,“Name2”:“Wert2”,“Name3”:“Wert3”,“Name4”:“Wert4”,“Name5”:“Wert5”}
Thank you for your help. When I display the TinyDB entries, the control module recognizes them as a directory. However, if I output the output to a text field, the error is returned when I try to save this directory text in the Tiny DB. I would like to save the TinyDB in a file and read it back in and restore it later after a new installation of the app. I thought it worked best that way.
Thank you for your suggestion and the effort. But the problem is that after the new installation all data is deleted from the DB. So I can’t import anything from this DB. It has to come from an external source, is that possible?
Seems you’re newbie at this segment! Please search the community as most of the questions has already been answered. Community is helpful for those who help themselves first!
For sure. Possibilities are limited only by your imagination.
you could ask the author @juananton1991 of that extension, if there is a new verison available…
are you talking about the tag or the value?
before taking a screenshot please switch the language to English… thank you…
which extension are you now using? any link? I can’t see any extension specific blocks?
If an entry (value) is not just a text, but a list, this list can be read from memory and used normally. If you export entries and later import them again, the list can no longer be used. The entry (value) is no longer recognized as a list.
Thanks for the tip about the new version. I’ll take a look. My solution on the screenshot doesn’t use an extension. An extension was my first idea to implement the backup function, which didn’t work due to the error. Therefore the attempt without extension to build a backup function. The data is all saved properly again, now there is only the problem with the list (which is no longer recognized as a list).
are you talking about the extension from @juananton1991 ? which error did you get? usually if there is an error, you contact the extension developer to report the issue…
I do not understand and can’t see from your screenshot, how that backup function works… Are you storing in a file? Lists only will look like a list, but are not really lists… You therefore should convert lists into csv rows before storing and converting from csv row into a list again after reading… there are blocks in the list drawer for this…
All data is read from the TinyDB and with ; and = are output separately to form a coherent text. The user copies this text and later pastes this text on the new cell phone and the data is transferred back to the TinyDB. The app thus has all the old data on a new device again. Later, the text is simply saved in a file and then saved automatically.
Okay, I’ll try to export the lists as CSV (so they don’t get destroyed). I’ll try it straight away.
I tried to use the extension again. No CSV and Json is generated, so you can’t save anything in a file. Does the extension work for you?
I have now continued to work without extension. Unfortunately, your tip with CSV and the lists didn’t work. This error message is displayed:
The operation list to csv row cannot accept the arguments: , [[Element1, Element2, Element3]]
Note: You will not see another error reported for 5 seconds.