Double Question: Rank Tables and Sorting options!

Hi everybody!

I’m currently building an app with Adalo but I’ve been stuck for a while with something I can’t get through with… and it’s a double feature!

First thing is, I don’t seem to be able to sort a list by a calculated formula. Is that right?

For example, I have a table o users, and a table of games, and they have a relationship so users can keep track of the games they own. So all I wan’t to do is have a list showing the users and sorting them by the “count” of games each user owns, but I just can’t see how. In the sorting options I can only see properties of the users (despite the fact they are related). The list would be a ranking of users with the most games f.i.

The second thing follows up to the first one. Now that you guys know I want to make a ranked list I’'m trying to figure out a way to make the position in the list appear as “magic text”. In that sense the first item of the list would be #1, second #2 and so on…

Any ideas on how to make this happen?

Many thanks in advance! The community here has been really helpful so far!

1 Like

@Frostjaw You are right: You can sort a list by the Count or Sum functions Adalo provides.
I suggest you add a GameCounter (type: number) to your table of users.
Each time you add a new game you have to create an additional action to update the GameCounter with a formula:
GameCounter= GameCounter +1
Same of course if a game is removed:
GameCounter=GameCounter -1

With this you can create a list of GameOwners and display the number of games owned.
You can sort the list by GameCounter, descending to show the rank.

1 Like

So… Great! That’s one problem solved!

Now to the ranking number. Now that I can sort everything by game count, do you guys thinks there’s a way I could set a number to reflect the position in the list of the users?

As in:

Many thanks for every thing! You guys rock!

2 Likes

We have no ranking function in Adalo available now. The only workaround that comes into my mind would be to do it in Excel or Google Sheets. That would involve shuffling the data out and back again via Zapier or Integromat after EACH change. I would not go this way and except the limits. Maybe someone will create a component in the future for the Component Marketplace that can do a ranking.

One question :
How are you thinking of calculating the Ranking ?
by game ? by total of games ?
Is it done automatically somewhere…usually that is the way its done…
just wondering

Well, as @karimoo said, I don’t think what I’m aiming to do is currently possible with Adalo.

What I was looking for is to have users SORTED by games owned, and then dynamically apply a number reflecting their position in the list. As in:

User1 | 10 games owned | #1
User2 | 06 games owned | #2
User3 | 03 games owned | #3
[…]

I can rank tables in SQL and think it would be a nice feature to create leaderboards and work with “competitive” data.

I’ll keep trying a workaround, but as I said, I don’t think it can currently be done.

1 Like

As stated, it is currently not possible to do this within Adalo natively. I think the closest feaure request for this would fall under this one: https://ideas.adalo.com/feature-requests/p/multiple-sorting-for-lists

2 Likes

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