How do I create a Leaderboard for a Game using TinyDB?

Hey there, coding peeps!

I am in desperate need of some help for my app. My app is a moving sprite game where you try to reach a high score after playing each round. The thing is, if you beat the high score already on the list, the previous high score disappears. So then, I tried to make a new variable and define it as the previous high score and move it to label2 (leaderboard spot 2), and now the score labels are correctly ordered, but the second name is blank or repeating the newly put name for the new high score. What am I doing wrong?

thank you! here im currently just trying to make it work with two trials to then recode for later leaderboard positions.

See the 5th link at

Hey there, coding peeps!

I was wondering if anyone could help me make a leaderboard on app inventor. My app is a moving sprite game where the user receives a score after each round, essentially trying to beat their leaderboard scores. However, I am running into A LOT of problems haha. I've been searching on YouTube but cannot find anything that's really helping me. Anything helps, thanks!

Here is one method for a leaderboard for tinydb. I chose to do it without any extensions. The example adds a name and score to a list. These are then combined and all items are sorted using javascript in a webviewer. The returned sorted list is json decoded and displayed in a list view.

tinydbLeaderboard.aia (5.9 KB)



1 Like