[Sovled] Update Cloud Variables at same time?

Hi! I m working with Realtime DataBase and cloud variables… But I m having a problem, when two users get or save a variable at the same time, they overlap each other.
I have to find a way to update the cloud variable like adding an item to a list (LIKE insert at first/last) Is that possible with a cloud variable?

Hey @Leito :wave:

I haven’t tried this myself, but surely one variable would end up being the variable, no?

Are you saying User A sees Variable B and that User B sees Variable A?

1 Like

For example, If both users click at the same time, both get the same value, = 70 for example

and if the automatic operation is value + 1 both will save the result of 70 + 1

the global result is going to be 71 instead of 72…
thanks!

Hi Jane, I m working with Cloud variables but I m having a problem… when 2 users click at the same time, the update the same value… How can I fix that?

Hmm interesting scenario. Are you storing each like values locally first before updating the cloud variables in case user internet connection drops?

1 Like

Thanks for your help! thats a very important detail but, also storing values in local storage first, if the clicks are done at the same time, the result will be the same (
For example, both get the acttually value = 70, (70+1) then both save, the new cloud value is 71 instead of 72… I think that a possible solution would be if I could “insert at first/last” in the cloud list so updates never overlap.
Its that possible??

@Leito - please don’t post about the same thing in multiple topics.

I’m merged your posts into a single topic.

1 Like

I kept tryng with many different things and I found a solution!! and very simple!

Although the click be simultaneous, with these blocks the information will never overlap.

Could you give me an example please?!

I dont want to be annoying but I have a similar problem, I need to save and get cloud variables to vinculate different users, but I need to conect only 2 users… so I get the values and the I set the variable to null but if many users click at the same time all of them get the variable, so

How can I do? Thanks!

@Leito is this related to this topic?

Yes, sory about the “Spam”
I don’t bother anymore. I could find a solution!!
I ve also found a bug with “In list remove #” with cloud variables, no matter which number you put, always will delete the last object was insert, also when you insert them, always will be inserted at last, they will always be inserted last even if you put insert at first. The solution to this if you want to remove a specific object, “In list set #” . With that block I could set any number to null and delete specific objects

Glad to hear it!

Thanks, I’ve merged them into a single post now

1 Like

I would disagree with this statement. Check out my blog post app NestdList here

I manipulate cloud list items using the in list get/remove # blocks

2 Likes

Thanks!! Nice blog!!!

2 Likes