TinyWebDB problem

very simple. but I won’t working for some reason
There is two app.
One app is making Quiz(A), other solve Quiz.(B)
A upload question and answer to TinyDB. it there is already some Q&As, then loading it.
B only load Q&As from TinyDB.

this is my code for B.
for some reason, app inventor refuse to load data from TinyDB when B case. It keep return empty list, however there is 5 element each. It keep saying “Select list item: Attempt to get item number 1 of a list of length 0: []”
I don’t know why, however
In this case, for A, it working well.

Q1. Do I not supposed to using DB like that?
Q2. How to fix this weird error?

1 Like

Have you named your tinydb tags as lists ? = e.g. tag - get global tagQs

1 Like

nah, It’s for tag name. It’s string.

1 Like

Where is “B” ?

The only difference I can see in your two block images is the “UpdateQAs” procedure block at the bottom of the second one. What happens if you remove that ?

1 Like

that is problem :frowning:
As you see, these codes are totally same.
but one is working, one isn’t working :confused:

So they both work if you remove that procedure ?

The GetValue calls are not for TinyDB, otherwise they would have value nipples.

They must be for an external database like TinyWebDB or FireBase.

So the return values are delayed until the appropriate .GotData event fires.

You would not find the results in the event where you would ask for the data, it’s too soon.
If you find the data during debugging, it’s leftover from a previous run.

@yvelkram it would have been better to not rename your components to avoid confusion
I updated the thread title...


Ah, sorry.
First, it is TinyWebDB :frowning:

and, I found error.
I cannot use It’s data in same when statement like

If I call GetValue Method and trying to use Its data at same when statement, It’s empty for some reason, or not ready in other words.

I found this when test Question making app.

again, very weird system owo
I’m getting like java more…