Sort CloudDB values

I'm trying to fetch values from cloudDB, which I did without any problem. But I wish to display those entries in a ListView, sorted in descending order (max to min).

Can anyone suggest any ideas..?

Easiest is to use a list sorting extension

1 Like

I tried the extension, it solves the problem partially, but, the data stored in cloud DB is alphanumeric, and I want the entries to be sorted based only on the numerical values, and I'm not getting the desired result.

Please show your relevant blocks and an example of the data output for your cloudDB values to be sorted.

Alpha-numeric values will usually be strings, therefore they will be sorted as strings, numbers will be sorted but alphabetically though: 1,10,2,3,4...

The storage is actually a leaderboard which stores names and scores of the players. I'm storing both the values (name & score) together. So, I need to find a way to sort the list based only on the score and the name should get excluded.

As previously requested, show an example of your data, then we can help you to a solution....

Maybe you could use

Instead of an extension, try Sajal's bubble sort

List Sorting On App Inventor | imagnity

There are several possibilities depending on how you store your data. You can store both the score/name as a ListOfPairs and sort just one the score.

See the suggestions on how to use a leaderboard in this discussion Need Help with leaderboard/scorebaord may help you design your leaderboard to sort as you want.

See the second and last entries in

after you have downloaded all your scores from CloudDB.