Copying tinydb to file and reopening

Hello

I need a little help here with trying to figure out why I am getting an error.

I have modified this example Save TinyDB to file and CloudDB. Retrieve the information from CloudDB and insert it into TinyDB

Saving the TinyDB to file

Saving the file name to a file to load a List picker

Loading List picker

Loading TineyDB with the selected game name from the List picker

Here is the error I am getting.

I can click Match 1, Match 2, Match 3, Match 4, or Match 5 fine but once I clear TinyDB and reload it is when I get the error.

Here is the file that gets saved
Test.txt (4.5 KB)

Thank you

Are you enabling a component somewhere in your blocks ?

Maybe it is because of true block in code below

Edit: wrong interpretation, please ignore this post.

Thank for the replay

Yes

I have buttons, checkboxes, and list pickers enabled or disabled depending on the game

But the TinyDB is called on every click on the Buttons of Match 1, Match 2 and so forth and it works fine with no errors till I clear it and reload it with the txt file.

Here is a video of what I was trying to explain.

App crashes after I load the file

Thank you

Show us how you parse this, and the code where you set .Enabled values:

Check Box 1 -> false
Check Box 1 Enable -> false
Check Box 2 -> true
Check Box 2 Enable -> true
Check Box 3 -> false
Check Box 3 Enable -> true
Check Box 4 -> false
Check Box 4 Enable -> true
Check Box 5 -> false
Check Box 5 Enable -> true
Match 1 Game 1 Info -> 5
Match 1 Game 1 Info Color -> -16777216
Match 1 Game 1 Player 1 TO1 -> -3355444
Match 1 Game 1 Player 1 TO2 -> -3355444
Match 1 Game 1 Player 1 Win -> -3355444
Match 1 Game 1 Player 2 TO2 -> -3355444
Match 1 Game 2 Info Color -> -3355444
Match 1 Game 1 Player 2 TO1 -> -3355444
Match 1 Game 1 Player 2 Win -> -16777216
Match 1 Game 2 Info -> 0
Match 1 Game 2 Player 1 TO2 -> -3355444
Match 1 Game 2 Player 1 TO1 -> -3355444
Match 1 Game 2 Player 1 Win -> -3355444
Match 1 Game 2 Player 2 TO1 -> -3355444
Match 1 Game 2 Player 2 TO2 -> -3355444
Match 1 Game 2 Player 2 Win -> -3355444
Match 1 Game 3 Info -> 0
Match 1 Game 3 Info Color -> -3355444
Match 1 Game 3 Player 1 TO1 -> -3355444
Match 1 Game 3 Player 1 TO2 -> -3355444
Match 1 Game 3 Player 1 Win -> -3355444
Match 1 Game 3 Player 2 TO1 -> -3355444
Match 1 Game 3 Player 2 TO2 -> -3355444
Match 1 Game 3 Player 2 Win -> -3355444
Match 1 Game 4 Info -> 0
Match 1 Game 4 Info Color -> -3355444
Match 1 Game 4 Player 1 TO1 -> -3355444
Match 1 Game 4 Player 1 TO2 -> -3355444
Match 1 Game 4 Player 1 Win -> -3355444
Match 1 Game 4 Player 2 TO1 -> -3355444
Match 1 Game 4 Player 2 TO2 -> -3355444
Match 1 Game 4 Player 2 Win -> -3355444
Match 1 Game 5 Info -> 0
Match 1 Game 5 Info Color -> -3355444
Match 1 Game 5 Player 1 TO1 -> -3355444
Match 1 Game 5 Player 1 TO2 -> -3355444
Match 1 Game 5 Player 1 Win -> -3355444
Match 1 Game 5 Player 2 TO1 -> -3355444
Match 1 Game 5 Player 2 TO2 -> -3355444
Match 1 Game 5 Player 2 Win -> -3355444
Match 1 Game 6 Info -> 0
Match 1 Game 6 Info Color -> -3355444
Match 1 Game 6 Player 1 TO1 -> -3355444
Match 1 Game 6 Player 1 TO2 -> -3355444
Match 1 Game 6 Player 1 Win -> -3355444
Match 1 Game 6 Player 2 TO1 -> -3355444
Match 1 Game 6 Player 2 TO2 -> -3355444
Match 1 Game 6 Player 2 Win -> -3355444
Match 1 Game 7 Info -> 0
Match 1 Game 7 Info Color -> -3355444
Match 1 Game 7 Player 1 TO1 -> -3355444
Match 1 Game 7 Player 1 TO2 -> -3355444
Match 1 Game 7 Player 1 Win -> -3355444
Match 1 Game 7 Player 2 TO1 -> -3355444
Match 1 Game 7 Player 2 TO2 -> -3355444
Match 1 Game 7 Player 2 Win -> -3355444
Match 1 Game 8 Info -> 0
Match 1 Game 8 Info Color -> -3355444
Match 1 Game 8 Player 1 TO1 -> -3355444
Match 1 Game 8 Player 1 TO2 -> -3355444
Match 1 Game 8 Player 1 Win -> -3355444
Match 1 Game 8 Player 2 TO1 -> -3355444
Match 1 Game 8 Player 2 TO2 -> -3355444
Match 1 Game 8 Player 2 Win -> -3355444
Match 1 Game 9 Info -> 0
Match 1 Game 9 Info Color -> -3355444
Match 1 Game 9 Player 1 TO1 -> -3355444
Match 1 Game 9 Player 1 TO2 -> -3355444
Match 1 Game 9 Player 1 Win -> -3355444
Match 1 Game 9 Player 2 TO1 -> -3355444
Match 1 Game 9 Player 2 TO2 -> -3355444
Match 1 Game 9 Player 2 Win -> -3355444
Match 1 Game Number -> 2
Match 1 Innings -> 0
Match 1 Innings Enable -> true
Match 1 Player 1 Call TO Enable -> true
Match 1 Player 1 Name -> Jeff Gebhart
Match 1 Player 1 Number -> 33003491
Match 1 Player 1 Race -> 5
Match 1 Player 1 Rank -> 6
Match 1 Player 1 Safety -> 0
Match 1 Player 1 Safety Enable -> true
Match 1 Player 1 Score -> 0
Match 1 Player 1 Team Name -> Shark Tank
Match 1 Player 1 Time Outs -> 1
Match 1 Player 1 Time Outs Called -> 0
Match 1 Player 1 Win Enable -> true
Match 1 Player 2 Call To Enable -> true
Match 1 Player 2 Name -> Luis Santana 
Match 1 Player 2 Number -> 33002731
Match 1 Player 2 Race -> 3
Match 1 Player 2 Rank -> 4
Match 1 Player 2 Safety -> 0
Match 1 Player 2 Safety Enable -> true
Match 1 Player 2 Score -> 1
Match 1 Player 2 Team Name -> Jesters
Match 1 Player 2 Time Outs -> 1
Match 1 Player 2 Time Outs Called -> 0
Match 1 Player 2 Win Enable -> true
Match 1 Stats View Player 1 Name -> Jeff Gebhart
Match 1 Stats View Player 1 Race -> 5
Match 1 Stats View Player 1 Rank -> 6
Match 1 Stats View Player 1 Safety -> 0
Match 1 Stats View Player 1 Score -> 0
Match 1 Stats View Player 1 Team Name -> Shark Tank
Match 1 Stats View Player 1 Team Points -> 0
Match 1 Stats View Player 1 Total Points -> 0
Match 1 Stats View Player 2 Name -> Luis Santana 
Match 1 Stats View Player 2 Race -> 3
Match 1 Stats View Player 2 Rank -> 4
Match 1 Stats View Player 2 Safety -> 0
Match 1 Stats View Player 2 Score -> 0
Match 1 Stats View Player 2 Team Name -> Jesters
Match 1 Stats View Player 2 Team Points -> 0
Match 1 Stats View Player 2 Total Points -> 0
Match 1 Total Innings -> 5

Apparently, the .Enabled attribute wants a logical (green) true or false value, not a piece of text that reads 'true' or 'false'.

Here is a little transformation function you can use loading your .Enabled attributes from TinyDb or a file:
logical

P.S. Probably the same applies to your Checked values in the Checkboxes, and any other true/false values.

Hello

Thank you for the replay.

I had to make changes to this as everything was being changed from the value to false if it wasn't true.

This is what it migrated to.

Thank you for the direction I needed

1 Like