TinyDB: read/select data from database, create list and assign to text label

Dear experts

I am trying to read data from my database (selecting of ListView items) and would like to assign the values to some labels. The first part with the mac adress works fine (see block screenshot). But for the for the labels "lbl_Coach_number_value", "lbl_train_assignment_value" and "lbl_coach_no_value" I always get the same data probably from the record of tag/key Number 1. Obviously I wronly feed the lists from "data1" and "data2" (using Selection/SelectionIndex).
Can any body help?

Thank you very much.

Kind regards,

Remo

You haven't proven a good match between the tag list of TinyDB and your various List Picker Elements lists.

You also haven't proven that your TinyDB contains ONLY 3 item lists.

Did you know that the Companion app shares the same TinyDB contents across all the apps it tests?

You are absolutely right, I haven't proven several things because I do not know any better. This was in first place why I came up with my (beginner) question.

My database has a datastructure as follows:

Key/Tag/unique identifier: MAC Address of device (ESP32)
Dataset 1: Device Name
Dataset 2: Group Name
Dataset 3: Free Number

The ListView Blocks above displays all records sorted by Dataset 2, Group Name whereas the MAC Address (tag, unique identifier) is shown correctly in the labels mentioned but not the rest of the data. See the red arrow markings in my blocks. Obviously that does not work the way I intended.

If anybody knows where I can find an example database that would maybe help.

Obviously the list with data "select list item list" -> "get data" is always populated with data from the same record regardsless of which selection ist made. So how do I have to modifiy the six select list item/get data blocks above?

I am aware about the same TinyDB content across all apps but I don't understand the implication for my project.

Thank you very much.

Export your .aia file and upload it here.

Thanks, I just found the error, selection of the Tag (MAC address) was erroneous.

I forgot to mention this common mistake among people who rename TinyDB1 and possibly add extra TinyDB instances:

Be sure those multiple TinyDB instances have different NameSpaces, so they don't overlap.

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