How to create a ranking system in adalo

So i have a function where user can see a leaderboard on whoever completed most of the events (the ranking should be the person who have completed the most at the top and then go down and lower the user the least amount of task completed), I have being playing around with the custom filter and was still struggling with it, is there any ways i can fix this?

Uploading: Screenshot (18).png…

Hey there @MaxZHou

You can accomplish this by adding a number parameter to the user collection and call it “Completed Events”.
Add an action when the user completes an event to take the “logged-in user > completed events + 1”

You can then use the number parameter as a sorting parameter with “Completed Events > High to Low”

Hi there, firstly thanks for the reply!

I went ahead and tried your method out, i was able to set up the things you said correctly, however it is unfortunately not working when a user click on the toggle their completed event will not update in the database, is there a solution to this?

I tested it, it works here.

Here’s a screen recording I just did to show you:

Hi check this out, not really working on my side i don’t know why…

and here is the clonable link if you want to check out Str1ve

The user has to click the toggle for the number to update.

This is not a method to sync the numbers, only allows the users count to increase on click.

So does that mean it can’t work in this case? Is there any other sloutions?

It can work just fine. I’m not sure what you mean. The user has to click the toggle to complete the event, correct? This will add 1 to their current count. You need to add their current counts manually.

Dont overthink it
Watch my video carefully. The +1 and -1 actions on on and off.

Hi yes it is working in the database i can see there is numbers in the completed events section, however, it is still now showing in the list.

I would simply do a collection of items with a relation property with users called “completed by”, and a numeric field called “n. of completed items” . So when you toggle on that box, it will add the user to the completed by field and update +1 the current usern number, otherwise will remove him and remove -1.
Then in your ranking list just sort by current item - n. of completed items - High to Low
Remember to set up that number to 0 once the user sign-up for the first time

Hi sorry what exactly do you mean, so does this mean i have to creat a new collection? How would this work? Thanks.

I’m sorry if my English is bad. I’m just saying that your numeric field (rating) should be in user’s collection. So once an user click the toggle on or off, it will do +1 or -1, also your collection of “tasks” should have a property in relation with users called “completed by”, so when an user click the toggle it automatically check if the same user has already completed the task or not, and based on that will correctly do the +1 or -1 operation

Hi guys i think it is fixed, thanks so much!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.