How to check a dynamic component text already exists in tinydb?

Hi,

I am saving the dynamic component text in a tinydb to get the saved text on another screen.

I can successfully save the text data in tinydb by assigning an incremental number as a tag but I can’t find any solution to check the existing tinydb value before storing the same dynamic component text in tinydb to avoid duplication.

Can anyone provide a solution of it? Please let me know if you need more information.

Thanks!

How are you storing the text in TinyDB? I mean is the text stored in the form of list or a single string?

I am storing texts in form of list.

Can you show me the blocks where you store the dynamic component text in TinyDB?

I am storing text in form of list. I will post the blocks soon.

First you told you are storing a single string and now you are telling it’s a list.
Be firm with your answer to avoid unnecessary confusion.

Here are the sample blocks which simply checks if the provided text is in a list which is stored in TinyDB.

blocks (7)

Sorry! I was confused with your question.

Hi,

Here is what I am doing with your suggested blocks and I am getting the error - The operation is in list? cannot accept the arguments.

Screenshot
Screenshot2

I am adding a tag as an incremental number that’s why I used a loop to check all tags.

Please check.
Thanks

But why you are storing the Label2.Text in multiple tags of TinyDB? Instead you can add the label text in a list and store that list in TinyDB under one single tag.

For your displayed blocks, it’s obvious to show the error if you use my method showed in previous reply.

Thanks for your response!

I am using the Dynamic component and I am storing different text each time in Label2.Text means the value of Label2.Text change each time I store in TinyDB.

I hope you got my point.

Thanks

I am saying that instead of maintaining different tags you can store you Label2.Text in a list and store that list in TinyDB itself. Then when you want to store new Label.text then simply you store it in this list saved in tinyDB

Understood! I will check this way and update the result here.
Thanks

1 Like

There is one problem with this. It works only when the same screen is open as text is being stored in list but when I refresh the screen or open the app again, list is empty and it doesn’t check the previous values stored in it.

So I think I have to check tinydb for checking the existing data. So how can I do that?
Any help?

Provide a sample aia. I will have a look