Pls help my code using TinyDB isnt working

Well, so the program is that when the user inputs the textbox and saves it using a button, the value of the textbox is stored in a variable and the variable is stored in tinydb, and when you reopen the app the data is there in the listview, but the problem is that the data isnt showing in the listview. Please review my code and check if theres a problem, coz Im kinda new to this app. Ive tried it on other devices but it wont work.

Two things:

Use create empty list instead of an empty text block for ValueIfTagNotThere in your GetValue

Set the add items to list block, before you save the list to the tinydb in Button1 click

Man I did try your edits, but it didnt work :slightly_frowning_face:

Show your revised blocks

A basic example:

"list" is not the same than "LIST"

1 Like

done but this error is showing and it doesnt work.

Clean the tag "list".

And you still have GetValue twice in the Initialize block.

You're testing on iOS, and you have a DataFile component?

See that grey bar?

It means the DataFile component is not yet working on iOS.

(Before i learned to read these bars, I was waiting for them to all turn green.)

so the solution worked, but only for screen2, but when I need to do the same process for screen3, it doesnt work and instead the data is saved in listview1 of screen2 instead of listview1 of screen3 and when I close and reopen the data on screen3 is missing and is there on listview1 of screen2 instead. Here's my code for screen2 and screen3 respectively.

Why are you using an empty tag in tinyDB?? Change that.

Also make sure you have the same namespace for TinyDb on screen2 and screen3.

Got it!

Its working now, thanks :smiley:

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