Values are not identical compare tinydb tag with marker title

Hey there!

I'm trying to get started with App Inventor, but there are still a few things I can't quite figure out.

I have a list of markers on a map that I want to compare with marker titles stored in TinyDB (these represent the markers that have already been completed).

When a marker is clicked, I set actualMarker using the AnyMarker.Click event.
Then I store the title of that marker as a tag in TinyDB.

On Screen.Initialize, I run a procedure that loops through all the markers and checks if their titles exist in TinyDB. If so, I make those markers invisible.

But for some reason, it’s not working — even though the values should be exactly the same.

Any help is appreciated!

1 Like

You can't store components in TinyDB.

Only numbers and text and structures built up from them

Yes. I'm storing the marker.title not the whole component. That should work or not?

Based upon my previous blocks from your other topic, try like this:

Sorry, but I just can't figure it out...

I need to save the marker state at a different point in the app — specifically right after the correct answer is clicked and the riddle is completed.
At that point, the corresponding marker should disappear and stay hidden, even after switching screens or restarting the app.

I've tried this:






You have moved on to something different!

Can you confirm that my blocks will do what you asked for first in your first post. Then we can begin to look at what it is you want to do next...

We may have to take a step back even further, there is some weird logic going on: to be able to click a marker, it must be visible, from what you say you want to make markers visible after they have been clicked...

You might need to write out the user's workflow, step by step, to be clear...

Oh, I guess I didn’t explain it clearly before.

I still want the same effect as in the beginning:
When the user clicks on a marker, a riddle opens. Once the riddle is answered correctly, that exact marker — the one linked to the riddle — should be hidden, so it can’t be used again.

The hiding is done inside a Clock event because I needed a 1-second delay to show the correct answer button in green before continuing.

I hope this makes the structure from earlier a bit clearer!

Why all the blocks to make markers visible ? Or is to make them not visible when the riddle has been solved? How is the riddle marked as solved ?

Yes as written before, after the riddle is solved the marker is meant to be invisible.

The title of the solved markers/riddles should be in the global list "Erledigt" through the tinydb.

Or is there a better solution?

I think I managed to organize the lists correctly. However, I’m now constantly getting an error during the comparison.
image

I tested it with other Titles like "test" but it doesn't works. i also tested if both values are a string: they are.

Looks like you are trying to find a list within a list. You might need to get the value out of the first list (select list item index 1)

Show us the new blocks.

I believe those [ and ] wrappers are part of the error message and not of the inputs, so your list is not a list.

Check your TinyDB default values, avoid using text for empty lists or single item lists

First, this part should load the already completed riddles from the TinyDB:

Then, in a separate method, I compare the markers by adding them to a list:

The TinyDB gets updated in a Clock event, after the correct answer button is clicked:

You have a contradictory setup for tag Title.

In one place you expect a list, but in another place you replace its value with a text marker title, losing what was already there and putting in a new data type.

I assumed that TinyDB stores all values as a list under one tag. Is that not the case?

Exactly wrong assumption

Yeah that it was so i just needed to add a list instead a string.

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