How to get position of player in OrderedDataStore?

Let’s say I have an ordered data store linked to a leaderboard that shows the top 100 players based on some in-game currency. To fetch the top N amount of players all I have to do is use GetSortedAsync, however, how can I fetch the leaderboard position of a player using their userId/key(so for example I can show to the current player their position in the leaderboard is top 820 without incrementing and iterating through datastore pages)?

It isn’t supported functionality afaik. There are a few feature requests, the one I found dates back to 2015, that exist to suggest getting a player’s position but none of them have been addressed. The best you can do is use GetSortedAsync and hope the player ends up in the list, if they don’t end up in the list then you’d just show a question mark or something.

It seems like such basic functionality to me so I don’t know how or why it isn’t supported but :man_shrugging:

2 Likes