How to compare firebase value from different bucket?

After completing task i want to store their score in different bucket (Bucket upto 5).
How can i compare each value (number) from all bucket whether the current score is greater or less.

(how i did)
First i check the 1st bucket is empty or not, if empty then i stored. If not empty then i check the value is greater than current score or not. If value is smaller then i store current score, but how do i move / change the previous value to another bucket?

I don’t understand. Can you show you full blocks picture ? With fullscreen firebase picture

1 Like

Bro, do you know how to compare firebase value from different bucket?

Ex:
Bucket1
Name1 : 30

Bucket2
Name2 : 20

Bucket3
Name3 : 100

Bucket4
Name4 : 50

Bucket5
Name5 : 90

How can i compare all these values?

There are much blocks needs to create this kind of logic. So i recommend you to create just one bucket and inside bucket you can add tags and in tags you can add lists

1 Like

Ok. Let me try again

1 Like

You can create 1 bucket name “Leaderboard”.
In this bucket you can add data like.
Create 2 tags
Tag1 “Name” Value = [“name1”,“Name2”,“Name3”,“Name4”,“Name5”]
Tag2 “Score” Value = [“30”,“20”,“100”,“50”,“90”].

Just get these 2 tags value in 2 global Variables and join “create empty list” block in these global variables.
Than you can easily compare two numbers like this.

If
Select list item “list” global variable Score
Index 1 =
Select list item “list” global variable Score
Index 2
Than show toast(your logic)

2 Likes

This method might work. Im trying

1 Like