[Solved] How can I interface a value from Firebase RDB to Thunkable?

Hi there! I would like some help in interfacing with, or at least getting the value from, my Firebase RDB to Thunkable. I watched a couple of video tutorials, but they were for an older version of Thunkable; now I’d like to know how to use the new version. I can easily do this in MIT App Inventor, but is this possible in Thunkable?

All I watched was about signing up and signing in, but there’s nothing about interacting and not setting the value.

This is my block in MIT App Inventor:
image

And I want this Firebase database of mine:

To interface with this Thunkable app that I design:

All I have managed is entering the API and URL of my Firebase to Thunkable.
But making blocks is extremely difficult for me. I would appreciate a demo app that can do this so I can analyze it for myself. Thank you in advance for your future responses!!!

@zian.muinxij check this example

1 Like

I find that example confusing because you’re using a variable for the name of the cloud variable instead of a text string. I generally try to avoid that because it adds an extra layer of complexity.

The basic idea is to set a cloud variable with the path to the Firebase data. So if your Firebase database looks like this:

Users/
…UserID
…12345
…Age

Then to set the value of the “Age” key/property, you would set cloud variable “Users/UserID/12345/Age”

Keep in mind that if your Firebase data contains arrays, you will need to use the list blocks to reference that data.

1 Like

Hi, thanks for the advice but can you show me a snippet of blocks that can interface this cloud variable to a label?

Hello,
Have you tried to implement any cloud blocks?

Can you try rephrasing the question please?

We would be happy to offer support.

1 Like

So far, from what I understood, this is what I managed to make:

I was trying to use this cloud variable to store my data from Firebase but what I don’t get is how to store this cloud variable to an app variable which I can use to interface/show this is my percent label. I need to store 3 variables. You can see in my screenshot of Firebase Database, I need to interface these Tank1, Tank2, and Tank3 at the same time. And the data will also update in my screen in their respective label.

I just want to change this percent label:

to the value from my Firebase Database here:

Again thank you for responding to me :slight_smile:

This can be done with the following blocks

You can use the “set variable” block when you want to update these variables

Let me know if it worked for you.

2 Likes

Thank you very much @ioannis !!! You really saved me; it works!

Now, I finally understand how this cloud variable works.

@zian.muinxij That’s great! I am happy that I was helpful.

1 Like