Read from DB multiple values

Hello i am using these blocks to save some values to a tag...
My question is how can i read the values of a tag.... and project each of them in different textboxes ?

Thank you very much!!

Either use TextBox1.Text, or find the correct tag from the GetTags list ?

Since you are printing all the tags in list view

Try like this

After list picking 
Init local variable to call tinydb get tag (listview selection) if value not found create empty list)
Set  text box1 to select list item list (local list) index 1
Set text box2 text to select list item list (local list) index 2 

What do the values mean?

i use some textboxes to enter data.... (name, number ,email, etc)
and when i click a button i store them in a tinydb.

I want when i click another button using a tag for a search, to preview the entries that the tinydb has with the particular tag....
after that i would like to use a list view to see the entry by its tag, and when i click the enty at the listviewer to see the rest of the enty in the textboxes...

Given your application functions, this sounds like an address book using person names as tags in TinyDB NameSpaces, one per lookup value (address, phone, email, etc.) ,

  • AddressesOfName (tag=person name, value= list of addresses)
  • EmailsOfName (tag=person name,value=list of emails)
  • PhonesOfName (tag=person Name, value= list of phone numbers)

optionally supplemented with extra NameSpaces to allow reverse lookups, like

  • NameOfEmail (tag=email,value=person name)
  • NameOfPhoneNumber (tag=phone number, value=personname)

There are LOTS of different ways to store data like this, depending on your needs (offline vs online, need for search, frequency of update.)

Ok i understood what you said. My problem is not how to write to a TINYDB but how to read from aTINYDB

let me give you an example....
I make an entry with a tag CHRIS and the values i store is "123456" "oxford street" "chris@gmail"

how can i do it using the GETVALUE to put the
"123456" to textbox1 the
"oxford street" to textbox2 and the
"chris@gmail" to textbox3

Thank you very much!!

Store the values as list


1 Like

(tag = valueOfTextbox1 as per your previous blocks image)

1 Like

i will give it a try and tell you my results!!

It works just as i expected!!!! THANK YOU VERY MUCH!! Three more questions...

  1. Instead of having the "create empty list" we can add a notifier to inform us that there is not such an entry..correct? and if there is no entry the blocks below will not be executed...correct?

  2. How can you store a same tag with different values in tinydb without overwritting the previous?

  3. Are there any storage limitations for the tinydb? I mean... can you create a database of 300mb storage for example?

Just test for an empty list, then show the notifier

If your device has the storage capacity, yes. However your data returns may slow down with a large dataset, you may be better off using SQLite.

Do you want to add a second/third/... set of values to the same tag ? If you are using Textbox1.Text as the tag, this needs to remain the same throughout. You don't have to set Textbox1.Text in the list, you can use the tagname for that.

Hello everyone.
I have the same problem or doubt, more or less.
I have a set of ~500 rows or records.
Is tinydb suitable for an app like that???

No if i have made a record with a tag Chris and i want to add another Chris then it overwrites the previous entries.... Can i have in my tinydb 2 same tags with different values?


is there any solution that you can think of to overcome this problem?
Because as far as i understand if you want to search in the Tinydb you do it by its tag.... correct?

Hello, @Negrazo49.
Take a look at this:

1 Like

Here is a sample for you:

1 Like

It is possible to set a listview's elements to the values of all tags, for example.

sorry but i cant understand what you mean...