I have my Firebase account linked to my app for Realtime DB and Sign In. Using Cloud Variables for the data collection. It works, and I am able to get users to create an account w/ unique User IDs. My problem is instead of the data being associated with the user ID which entered it, it is associated with a count-up. See Below
‘0’ and ‘1’ both have the right data and are associated with unique email address, and any additional data saved just continues the count up.
Is this something to address with code in thunkable (needing to use the official Realtime DB blocks), linking authentication with the Realtime DB or something else altogether?
It seems you are adding info under the user ID but you are not providing a key for the info being added therefore Firebase generate the count or numbering which is the expected behaviour of the Firebase database. You can then retrieve the saved info into a list where every element in the list will correspond to a numbered entry under the user ID.
My question is more on how to be able to have data entered in the thunkable app following log in, be associated with that users ID on firebase. That will allow me to set certain firebase rules regarding use of the data. But if the data is simple a sequential count, I cannot set those rules.
UPDATE***
My original code saved the Cloud Var as a List (see below)
So my question is, is there a way to specify on a Thunkable App that an authenticated user of X user ID is the one altering the Realtime DB so as to make their User ID the Realtime DB key
When you mention UserID via the sign in block, is that the Thunkable block? or by saving “UserID” will it know to link it with firebase authentication userid?
I do have another question though, I am able to successfully transfer text data to realtime DB and transfer “blank spaces” as just a text block. What is weird though, is if my text input is empty i.e the user did not put any text in it, then the database will not accept any transfer. I am failing to understand why the database does this if it can accept empty text boxes?
If all “Inputs” are filled with text then transfer goes ahead. Even if 2 blocks are taken out (like the second picture" transfer goes ahead. BUT, if say the Name input was empty, then no transfer would go at all. Not sure why the database does that?
if text input is empty instead of null and it caused the app to crash so I thought it was the whole function not my mistake of using empty instead of null. Thanks so much Jared