How do I get all the names of all the users I have in the Firebase Database in a list?

How do I get all the names of all the users I have in the Firebase Database in a list? I tried this and it wasn’t:

image

The path to “Nome” is usuarios/[userid]/Nome

You’ll need to join “usuarios/” with app variable userid with “/Nome”

Like this? If that’s how it didn’t work, it gave the error of “undefined”.

To understand why this isn’t working, you need to know what the join block is doing.

If you join all of those blocks, you get this:

usarious/app variable userid//Nome

You can’t have a double slash //.

I understood, I hadn’t noticed this mistake, I did it this way but the mistake persisted:

Try adding the ‘make list’ block to the simpleList block and see if that works. It could be that it isnt saved within the DB as a list. When I make lists and save them to Firebase I dont save them as a list, I save them as a comma divided value so it saves space but also makes it easier to read/write. When I call my lists I use the ‘make list’ block.

What is the value of the green error block and the value of the green value block?

Still undefined and null?

The error continues

I am asking a very specific question. If you assign only the green value block to a label or text input, what appears on the screen? Because the way your blocks are, you’re doing something different that won’t help me figure out what the problem is. Sorry if you’ve already done that, but it’s not clear from just a screenshot of circled values.

Also, what is the value of only this set of blocks if assigned to a label or text input?

Lastly, you can manually attempt to get a value from Firebase by hard coding the userid based on something you already have in your Realtime Database. Have you tried just entering a text string userid instead of the app variable userid block in the screenshot you posted? If so, what are the values of the value block and this set of blocks?


image

You’re using the Snap to Place interface, right?

Can you export the realtime database from Firebase as JSON and share it with me?

Also, have you checked to make sure that your realtime database rules are correct?

I just did a quick test of my own realtime database. Here’s what the database looks like with the url hidden just above “users”:

Is your database url the root right above usuarios?

These blocks worked for me:

image

Double-check your Firebase settings in your Thunkable project. Is the API key correct? Is the realtime database url correct? I assume they are because you’re getting a response of {} but it’s still good to check.

[Aside: bonus points to anyone who can name the movie quote in my realtime database screenshot above without Googling… it’s an obscure one! :thinking:]

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