I’m getting rather confused on what is the best method for updating a Firebase Realtime DB. I’ve seen some posts and videos on using a Cloud var to handle this and I have also seen content on using the Realtime DB functions. I’m rather new to Thunkable and not sure what to do? Is this more of a “Case by Case” type of thing and each option has pro’s and con’s? I’d rather not get myself into bad habits early in my learning.
The cloud variables are the ‘new’ way, and the only way that’s supported in the new interface (which I mostly am not using, because it doesn’t yet have all the features I want).
Most of the time, in the older interface, either is OK, but the BIG difference is that cloud variables are SYNCHRONOUS, while the old purple DB blocks are asynchronous. So there will be specific times where one or the other is better. (Need your columns of blocks to STOP until your DB updates? Use a cloud variable. Want to update a whole bunch of values all at once but don’t need to wait for it to happen? Purple DB blocks.)
Thank you for this. I’m having a really hard time figuring out how to do an update and delete on anything using the cloud var method. There seems to be plenty of examples on building and showing the list but the update is a bit harder to find.
To update, just set the value to whatever the new value is, just like a variable.
To delete, set the node to null. (Be careful - don’t ask how many times I messed up my test database because I didn’t have the node right.)