Dynamic Textbox update in TinyDB

Hello fellows,

It took me some time to figure out how to store and retrieve data from tinydb into dynamic textbox. You can see the attached code blocks. This is for a voice note taking app.

But now there’s a bigger dilemma. What do I do if I want to edit/update a dynamic textbox. How will it get updated into the database and how will it be retrieved when I reopen the app.

If there was a way to retrieve a list of all the dynamic textbox and their text as well as the id of the one that’s changed, it would be easy. But I dont think that’s possible.

I dont want to use listviews, labels or other methods. I want to be able to do this using dynamic textbox. Any help is extremely appreciated.

To edit/update your notes, the user have have to first display them in the textbox. To do this, let the user speak the date of the related note via speech recognizer.
The speech recognizer result would be then compared with the list stored in your database.
And if the match is found, your app will display the related note in the text box, for the user to edit/update.

But this thing seems theoretically possible. However it would be matter of trial-error practically.

It’s a bit impractical to have the user speak the date. The idea is to edit using the keyboard. But thanks for your input.

You don’t want any listviews, neither you want your users to speak. Then how do you think the user will know about the saved notes.

(Now I am assuming that either your query is not clear your or I failed to understand it in a better way)

Yes, you misunderstood. The user speaks the initial note, but for editing it will use the keyboard.

Read my first reply again, I meant the same :point_down:

No :slight_smile:

All the notes are already in dynamic textboxes (as they were spoken by users). So you can just tap on one of these textboxes and edit the note. But how do you update then the database? And further retrieve the data upon reopening the app.

So do you mean that when the user opens the app, all his/her notes are already displayed in the dynamic textbox?

Edit: Ok, I now saw your blocks and it seems its working the same way as I mentioned above.

One way of getting the ids of dynamically created label, is by getting the index of the items(notes) you have stored in the list as well as in database.

How would you iterate over the ids of the dynamic_textboxes on the screen?

L.E.:

I mean, not only on the ids but on the dynamic textboxes themselves.

What I’d like to do is:

for each dynamic_textbox:
if dynamic_textbox[id].text != list[id].text:
then make them equal (thus, update the list and the database)
else:
do nothing.

Do you think that’s possible?

First make it clear, are you using dynamic textboxes or dynamic labels?

I tried both and couldnt get any to work. And I reverted to listviews. Thanks.