TinyDB with three fields to be created with two different "spinners" and with a textbox

I've read the tutorial "Working with Lists and TinyDB" but it's still not clear how to adapt it to my needs. So I ask for help:
I want to create a database on Tinydb with three fields ("text" and not "numeric"): each element of the first two fields comes from entries contained in two different spinners and the third from a textbox (Example: Type, Subtype, from spinner and from textbox the "Explanation")

  1. To enter data into the database, article by article, how do you recommend writing the code?
  2. Then, to "search" the data of my interest in Tinydb, using both previous spinners at the same time (this will allow me to search for a precise, unique, memorized value) to read the third element, that of the textbox (the inserted element above with the textbox as "Explanation"), again, how do you recommend setting the code??
    Thank you
1 Like

To answer this question, we need to do some data modelling on your data.

Do you have some sample data you can show us?

We need to see which data depends on which other data.

what part of the code do you want it to show?
I got correctly Spinner 1 Selection, Spinner 2 selection and I have the textbox ready to write on.
If you want I can send .aia

None of it.

Do you know the difference between code and data?

sorry...but i can't load my database. I keep trying.
dati

Seems you want to do something like this:

(I have used the label just to display the content of the stored list of lists, you would work with global db and update it to tinydb EVERYTIME you make a change - as is shown in the Button1.Click event)

Have you ever used a spreadsheet program?

What would your data look like in a spreadsheet?

Dear Timai2 I think you understand exactly what I need. Now I'm not near a computer: so in a few hours I'll sit down at my desk and try your suggestion.
Meanwhile I read and study your code to understand my mistakes. (I'm a beginner eager to learn)
I feel like goats inserting data into TinyDB with button 1; and with button 2 I should get the total database list;
If so, can you suggest me how to set up the spiner1 + spinner 2 combined search to get the label of the text that I had entered via the textbox?

PS
Dear Tomai2 your suggestion for the three spinners you gave me for the other app worked great. I hope one day by continuing to follow you, to become "a little good" :smiley:

image

This will return the first result that matches

I just sat in front of my computer: I have an hour free and I dive ... I'll start trying right away and I'll let you know; Tonight I will have the right time to work and totally modify my app. But with your suggestions I'm "sure" that everything will be fine

Help: dear Timai2 I started to insert, adapted, your code. However, I can't find the green "end" with two joints

Right click on the and block and select external inputs

I can't get it :sleepy:

image

image

1 Like

How I'll get home run it your very thorough explanation.
Thank you also for your great patience

I apologize but last night I could not have time to get on the computer :cry:. This morning I got up earlier and I adjusted the suggestion of Timai2 for memorizing the various voices and ... Everything works perfectly. . 1st thanks to Tomai2 :wave:. Around lunchtime I will go home and proceed to adapt the request with the two spinners; but I'm already sure I'll add to Tomai2 the 2nd thanks :slightly_smiling_face:

@TIMAI2 Dear Timai2, I'm "arguing" with your suggestion of the "button 3", the one for the search through the two spinners to get from the label the corresponding text I entered previously with the textbox: I receive the error instead: "The operation is in list?cannot accept the arguments". I can't find my error...

Show your relevant blocks

@ABG
No...

@TIMAI2
scrnli_4_7_2023_20-37-50
Until the previous block everything OK, then.... :cry:

index=3 because I put the two spinners first and then the textbox. However I tried in vain even with 1

Look at my blocks again, do you you see something different ?