[Solved] Help me solve this firebase obstacle!

Screenshot%20(76)

everytime a value is updated/new value is put the old one replaced im rookie to firebase so explain to me like im a 9 year old thanks!

1 Like

Do you want to add the data from firebase with your new data. So if your text input is 100 and then number in firebase is 50, you want firebase to change to 150?

basically this is an exam section i will hand out codes to student who wanna give exam and when they enter exam there are 3 options full name school name and their codes(that i handed) all i want is that when they enter their details it goes into my firebase account i dont need to retrieve the data i just need it saved but to test it out i first put random name and details and submited and everything was sent to my firebase so i tried to make a random detail to check again but the new details replaces old one this is the last step i need to fix before my app is complete so i need help

1 Like

Ah okay, i understand now. So if you are confident that each student has a different name, you could make the first tag their name, and then have objects within it giving age, exam code, school name, etc.

Kind of like this:

image

If you think they might have the same names, you could have their name, and then join a random 4 digit number to the end. Obviously there is a minute chance that they could be the same, but I would be certain it would work :stuck_out_tongue:

(edit)

Also how many students do you plan to send this out to?

1 Like

about 10+ for starters and i dont think i can put their name as a tag because they might have a bizarre name and if i dont have it in my tag it wont get registered? or is that not how it works ? i have never used firebase so guidance would be very helpful

1 Like

Should be fine:

i dont know every students name so wont that be a problem

1 Like

No. The names you see above (david, steve, etc) are what the user will enter. Then we will save objects of this tag.

1 Like

I will make a mock up project for you. I will post it here soon :slight_smile:

Then you can just change the firebase account to be yours and not mine

3 Likes

Here is the code you want to use:

You can find out more about objects here.

Alternatively, if some students may have the same name, you can add a random 4 digit to the end like this:

As you can see, here many people named Bob have entered their details, and each one has a unique ID at the end:

Hopefully this helped you out :slight_smile:

If so, you can mark this post as solved, if not I would be more than happy to assist you further.

3 Likes

IT WORKED !!Thank you ! im gonna mark it as solved but before i do just one question can you explain the variables you used and why and what they do because thunkable support was telling me different ideas like make app id and so complicated and you gave an alternative and solved my issue in 2 min i wanna learn more about variables and other blocks like creating object i spend 11-12 hours on thunkable watching videos and reading docs but they arent as informative they dont teach me to make a new thing they teach me to make one thing and im sure if you make a post or something explaining in simple terms alot of people would benefit

1 Like

There are no variables in this project. I renamed the text input blocks to name, exam code and school name.

You will know a block is a variable because it will be a strong orange colour. Here is an example of what a variable looks like:

You don’t need to use variables unless you are doing a lot of calculations as such with 1 piece of data. In your case, the most efficient way is to not use variables.

Hopefully that answered your question :slight_smile:

To add to your point on Thunkable support. The staff here is very helpful, I promise. I have gotten a lot of fantastic help from them. If you want the fastest help with your project though, the Thunkable community is the best place to go, as you will find community members and all the support staff active here on a daily basis. And a lot of the members here are amazing. They have some great ideas and are always willing to help out.

So if you are ever stuck again, be sure to come back!

thank you! but by vairables i meant different kind of blocks and their uses i really wanna become an expert in thunkable do you recommend any online courses or something for me to understand the basics that are used in thunkable

1 Like

There aren’t any such online courses, although, the Thunkable docs can be extremely helpful for getting started. The flaw I find with Thunkable docs is that the more advanced features, are explained in an advanced way, if you get me. So if you don’t understand some of the terms, then it can be tough to get a grip.

You can see the Thunkable YouTube channel here.

And this channel I find fantastic for videos. You can find that here. His username in the community here is @darren. I recommend his videos.

Of course, a great way to learn is to try things out the way you think they should work. And if you get bogged down, which don’t worry, a lot of us do, then be sure to come back to the community, where everyone is happy to help :slight_smile:

3 Likes

the name school name and code works perfectly but i want to add score to but name school code are in screen 1 then questions are screen 2 and finally where final score is given is screen 3 so i tried to add this set of blocks so score of screen 3 can join with screen 1 details and show all as one detail in fire base but its not working !

when you say join, do you mean that you want it like this:

image

If so, your best option instead of uploading data in different screens is to do it all at once, and save the other data as variables. So on the exam score screen, you call the upload of full name, flying schcool name, exam code and score. This will be much simpler and if you ever decide to expand it makes that much easier too!

1 Like

can you please send me a block? it would make it so much easier for me because i know im gonna get stuck after 5 min

it is the same blocks. just click the settings on the link object block and drag the item block under it. then you can change its name to whatever you want.

that would change few things for me is it possible that i can put password on one exam screen so no one can see it except when i want them to or do it in real time where i can enable or disable or any alternative and firebase authentications is very hard for me !

I might suggest using Cloud Variables instead of the Realtime DB component. Like the Realtime DB component, Cloud Variables use Firebase for storage but they’re generally simpler to use. So in your example, saving the object would look like:

Retrieving the value would look like:

3 Likes