Firebase Storing and Retrieving Information

Hello, this is not my first time using the FireBase experimental piece in Mit App Inventor however I always have a hard time trying to understand how to store and retrieve information.

I have no idea how but I had gotten the image(s) below to work though I can't seem to do it again. Is there an easier way to store and retrieve information than what I have been doing?

The way I have been doing it is confusing to myself because it seems like it's a 50/50 chance. Sometimes it works and sometimes it doesn't which upsets me because it's not a sure way that works constantly.

Also, I'm in the process of making another application however my experience with FireBase only allows the user to retrieve the last updated database, once. If the database is updated (x) amount of times the app will not get the new information unless the user closes the app and runs the program again.

image
image
image
image
image

You are missing two important blocks:
component_event (1) component_event

Also, when you ask for a tag list, you will get a list.
Treating a list like a piece of text for a comparison with an empty string is wrong.
It will never equal an empty text value.

548662afda5a14f6b214d6cb5aead6ce7f4b29d1

Ah, thank you ABG! I hadn't known that, I watched a YouTube video and that is what it showed me. The way I am storing and retrieving information, will that work or is there a better solution?

Also for this new application I am making I will have multiple categories in the database such as usernames for Discord, Instagram and Snapchat. Would you mind telling me how, if possible, I could separate them?

image

I would try this for adding a user name to a server user list:


It has the particular advantage over the set value block in that it only adds to the end of the list, and does not replace the entire list, thus avoiding interference between two simultaneous updaters.

If you need to store more than just the user name, you should read
https://firebase.google.com/docs/database/web/structure-data

P.S. Be aware that the AI2 Firebase blocks add markup to the tags and values to help it identify the data types when it retrieves the data. Compare your hand-editted values to AI2-created values, to see the difference.

I tried exactly that however I got an error:

FirebaseError

You can only append to a list.

I was worried about that.

You probably have to store an empty list under the tag before you can append your first item to its value.