What is 'for component' in Tiny DB

Sorry guys, new to MIT App Inventor, so rather a basic question. Trying to use Tiny DB. All documentation online gives Tiny DB 2 properties: tag and valueToStore. Yet, when I add the Tiny DB to my blocks I have 3 properties: for component, tag, valueToStore. I cannot find any reference online to the property 'for component'. What is this and how do I use/apply it? Cheers!

Sounds like you are using the AnyComponent >> Any TinyDB blocks. Unless you have many tinydb components (not necessary), just use the components found under Screen1 >> TinyDB1

Sometimes it is useful using >1 tinydb:
For example, a tinydb that is claared totally each time the screen opens and another that keeps the same data saved on the device's internal memory, that just will be clean if app is uninstalled or the user cleans apps' data via settings or storage.

Many thanks - that makes perfect sense. But how do I attached a component to the Tiny DB block with the property 'for component"? I've tried everything but nothing attaches !!

See below example

image

If you just have 1 tinydb follow @TIMAI2 's opinion. If you have many, you have two options: you know the tinydb that you need to store on or it is dependent from a value on a variable.

you know the tinydb

You should follow @TIMAI2's help

tinydb from variable

if you have a variable that stores the right tinydb, you may use something like this:
Test.aia (2.1 KB)
blocks(10)

I hope i was helpful...

Thanks everyone - you've all been a big help.

If you are using multiple TinyDBs, don't forget to differentiate their Namespace values, otherwise they will all end up in TinyDB1.XML

Thank you ABG - will do.

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