I don't know how to bring back this data

Hi I’m doing this code and if you can answer me by today still. I’m saving this data in firebase but I have no idea how do I bring it back to another screen, I’m going to make a screen where the person’s profile will be and there wi


ll be their information. Help me, I don’t know how to bring back this data.

Hi @luiz.primaz2ddpyu, welcome to Thunkable! :tada:

Be sure to check out our posts about How to ask Great Questions v2.0 and our Community Guidelines as you get started.

To answer your question:

You can retrieve that data in the same way you are setting the cloud variable but you also want to make sure you can grab each part of that object so you can use the get property of object block.
image

The object is the cloud variable itself and the property is either Nome, Sobrenome, CPF, or Email.

1 Like

Hi thanks for replying to me, but I still don’t understand, I’m new to this programming area if you can explain me again… I appreciate it, I’ll send you some more information below:

I tried to put the information in the code you sent me but I couldn’t, I’m new to programming.

image

I hope this information can help you help me, see you later and thank you.

You have “CPF” twice so you’re actually getting the value at …/CPF/CPF which doesn’t exist. You can either delete the get property block and just use the full Firebase path that you have (you might need to remove the “/” after “/CPF”) – that’s the way I access Firebase values from Thunkable – or you can just delete this block:

1c5a9419f52b40e26a76ea1976c862399afd4a32_2_690x208

1 Like

Did you mean that? It’s giving results as “null”

image



All of them result in “null”

What is the value of app variable userid when you display it in a label or text input by itself? Text input’s are helpful because you can copy from them and paste here on the forums.

Would you be able to export your Firebase data as JSON and post it here (if it’s not confidential)? If I could see it, I could provide the correct blocks for you. But based on what you shared already, the blocks you used should work so there must be something else going on. I would also try removing the leading “/” in front of “/usuarios/” to change it to “usuarios/”

Of course, here’s the JSON:

{
  "usuarios": {
    "cristina@admin^br": {
      "CPF": "0987512343",
      "Email": "cristina@admin.br",
      "Nome": "cristina",
      "Sobrenome": "salomao"
    },
    "luizeduardo@admin^br": {
      "CPF": "00000000009",
      "Email": "luizeduardo@admin.br",
      "Nome": "Luiz",
      "Sobrenome": "Eduardo"
    }
  }
}

You set your userID to a Firebase ID, but you saved the object under an email.

Example:

You saved it as this:
“luiz^primaz@aluno^senai^br”: {
“CPF”: “00000000009”,
“Email”: “luizeduardo@admin.br”,
“Nome”: “Luiz”,
“Sobrenome”: “Eduardo”

But you’re trying to retrieve it with this:
},
Htfc456ghd663g94Fhdsbnet…(A LONG STRING): {
“CPF”: “00000000009”,
“Email”: “luizeduardo@admin.br”,
“Nome”: “Luiz”,
“Sobrenome”: “Eduardo”

1 Like

Your data is also insecure. You shouldn’t be allowed to write to the database until after you have created an authorized user.

1 Like

Ok I understand that I was trying to look for something in the wrong place, but now I’m having another problem, I’m trying to save the user’s UID but it’s saving as null:

{
  "usuarios": {
    "null": {
      "CPF": "00000000009",
      "Email": "luiz@admin.br",
      "Nome": "Luiz",
      "Sobrenome": "Eduardo"
    }
  }
}


Try a different folder structure
{
“usuarios”: {
“Firebase ID 1”: {
“CPF”: “0987512343”,
“Email”: “cristina@admin.br”,
“Nome”: “cristina”,
“Sobrenome”: “salomao”
},
“Firebase ID 2”: {
“CPF”: “00000000009”,
“Email”: “luizeduardo@admin.br”,
“Nome”: “Luiz”,
“Sobrenome”: “Eduardo”
}
}
}

Rules Settings:
Something like this (correct me if I’m wrong)

{“rules”:{“usuarios”:{“$uid”:{“.read”:“auth.uid == $uid”,“.write”: “auth.uid == $uid”}}}}

Sign in screen example:
advanced block

Home Screen:
Retrieve your info

1 Like

Now I think it’s going to work, there’s only one catch, I don’t know where to find this purple block, I can’t see it…

You can right click on certain blocks and choose “Show advanced block”

I managed to do it, thank you all

image

3 Likes

Hello everyone! I recently facing an issue in Thunkable while accessing values from Firebase. I had mistakenly included “CPF” twice in my Firebase path, resulting in an invalid path and error.

However, after reading a helpful reply on the forum, I found the solution to my problem. I learned that I can either remove the “get property” block and utilize the full correct Firebase path, or simply delete the specific block causing the error. Thank You for your guidance.

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