Displaying and Storing User Data in Firebase

Hello there! I'm a bit new to Firebase and I'm having trouble understanding it all and using it for my app.

Here I have Screen A
Screen A
And its blocks I'm currently trying to figure out
BlockA
I'm trying to display the data such as name, age, etc by getting it in the Firebase which is here
Firebase
I can make or register new data by going to the other Screen which is Screen B
Screen B
And this is the blocks
Block B

What I'm trying to do is that whenever I log in to my App, the app will automatically get the data and display it on Screen A. And If I want to register new user data, it will enter said data into the list in Firebase.

I tried testing it with just the name, but it doesn't go into the list and instead makes a new list instead.
Bob

And even then, Screen A doesnt even display the name there. Can I get some help? Even if its just the name would be fine, since I can just copy that to the other data I need.

Your Firebase structure needs repair, to allow multiple pets stored by unique name:

  • Pets
    • Fleabag
      • Age: 3
      • PetType: dog
      • Weight: 20
    • Tweety
      • Age: 4
      • PetType: canary
      • Weight: 0.2
    • Meowrice
      • Age: 2
      • PetType: cat
      • Weight: 10

Also, see the advice about screens:

From your first firebase layout, try setting the tag to:

Pets/Name

or set the ProjectBucket to:

Pets
1 Like

I'll try testing that out. In the meantime, regarding Screen A. I created a Signup Page first, So when opening the app, you must login first before entering Screen A. Can I make it so when I enter the user and password, it would automatically call for all the data from Firebase on the users pet?

Also can you elaborate more on the uses on ProjectBucket? I've read its intro, but I'm still not sure how to use it.

If you are going multi-user, you will need a deeper tree in Firebase, and more specific tags (UserName vs PetName).

Here is a suggested new hierarchy:

  • Username
    • LoginInfo
      • Password
      • Login (The same as UserName?)
    • Pets
      • Itchy
        • ...
      • Scratchy
        • ...

Here is the Blocks on the Login and Sign Up Screen


The CrtButton is making the new Email/Username and Password for the user.

If LoginButton is clicked, It gets the Username, and then Firebase Checks if the username and password is correct. If it is then it goes to the Homepage.

I also heard your advice and did the Tree Hierarchy
Tree Heirarchy
Now its the issue of sending the data into its respective branch and then retrieving it. I'm still not sure how to though? I tried ProjectBucket, but I'm not sure I'm doing it right

Are you familiar with how to use your desktop computer's file system?

It has the concept of the current directory, where you see the subdirectories and files you are currently interested in.

Each file and directory path has slashes in it ('\' for Windows, '/' for Unix and Android) to show the navigation from the root folder to the current location.

The ProjectBucket is like the current directory location, and the keys under that ProjectBucket can have '/'s in them for further navigation into the data tree.

P.S. I don't like the idea of using tags like Pet1, Pet2,... because they make extra work for the database users when they want to see something by name, like a pet name. This wastes the power of the GetTagList block.

A little reading ...
https://firebase.google.com/docs/database/web/structure-data

I'm testing the ProjectBucket a bit, just doing some storing first. I tried putting it into the Tree Heirarchy I made previously, but it just made another one. It also seems to not work to make another branch
blocksign
Tree Heirarchy

Use a forward slash / and remove the spaces.

Well it works, but it still didnt go to the Tree I made
Tree Heirarchy

Sorry, I did not spot that you had created a tag called Users \ Username. I suggest you do not do this to avoid confusion!

I'm sorry I'll be more clear this time. So is there no way to send the data to the Tree I made previously?

Which tree, you have shown several parts, but not the whole, this makes it difficult to advise,. Show the full firebase data structure from the top, and indicate which tag you want to store / call...

image

pls use any username here(do not set it as username), and you can see the tree

image

Still not added
blocksign
Tree Heirarchy

image

image

What is the problem for you? where do you want to add tree?
image

I just want to put the Password and UserEmail here
Tree Heirarchy

Yes, but where is users in relation to to the main ProjectBucket / project name. As requested please show your full structure.


Tree Heirarchy
Just above Trackpaws1 is the firebase link.

OK, so your "path" to Password and UserEmail is

Trackpaws1/Users/Username/LoginInfo/