# Leaderboard list by user ids is returning global records instead

**URL:** <https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300>\
**Category:** Local Setup\
**Created:** [October 25, 2019, 1:05pm UTC](https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300 "2019-10-25T13:05:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![asheraryam](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@asheraryam](https://forum.heroiclabs.com/u/asheraryam)\
**Post date:** [October 25, 2019, 1:05pm UTC](https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300/1 "2019-10-25T13:05:53Z")

</div>

The returned records are the same as if no owner\_ids were provided. I also tried removing the 10 record limit but it didn’t change anything.

I’m using this code on the client side.

```auto
 let result = await backend.client.listLeaderboardRecords(backend.session, target_board, ownerIds, 10);
if (result && result.records) {
    console.log("Fetched records. %s", JSON.stringify(result.records));
    return result.records;
} else {
    console.error("Could not fetch leaderboard entries from backend.");
    return null;
}

```

The list of ower\_ids is something like [b2e7b3d8-8246-4c01-b0bc-fc729347ae11,014fb9ea-df8b-4682-bcff-b7eff92f85d5] of the type Array.

I’m not sure what I’m doing wrong, is it possible the owner ids needs to be of a specific object type?

With No provided owner ids:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/heroiclabs/original/1X/6b805c093ceb10c48051002a87f3bbb2ff1b5541.png)

With Provided owner ids:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/heroiclabs/original/1X/9a898893a80be69808ae01ef86d68c2b646b972a.png)

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [October 25, 2019, 2:02pm UTC](https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300/2 "2019-10-25T14:02:33Z")

</div>

@asheraryam In the JS client you should look at the `owner_records` field for results which come from the `listLeaderboardRecords` API request. 👍

> <https://github.com/heroiclabs/nakama-js/blob/master/src/api.gen.ts#L243-L252>

---

<div class="post-metadata">

**Author:** ![asheraryam](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@asheraryam](https://forum.heroiclabs.com/u/asheraryam)\
**Post date:** [October 26, 2019, 5:34am UTC](https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300/3 "2019-10-26T05:34:43Z")

</div>

Thank you that works!

I saw “owner\_records” several times in the docs but I just assumed it’s a copy of owner\_ids I passed. 😅

I had already given up after several hours and was considering scrapping the friends leaderboard altogether :b

---

<div class="post-metadata">

**Author:** ![novabyte](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/novabyte/32/1324_2.png) [@novabyte](https://forum.heroiclabs.com/u/novabyte)\
**Post date:** [October 26, 2019, 11:11am UTC](https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300/4 "2019-10-26T11:11:22Z")

</div>

We’ll try to make it clearer in the docs but I’m glad you’ve got it solved.

The reason we return both `records` and `owner_records` is because some mobile games like to display a leaderboard view which shows you, your friends, and the top X number of players on the leaderboard. So we give the option in the API response to bundle the two sets of data together. 👍

---

<div class="post-metadata">

**Author:** ![asheraryam](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@asheraryam](https://forum.heroiclabs.com/u/asheraryam)\
**Post date:** [October 26, 2019, 1:02pm UTC](https://forum.heroiclabs.com/t/leaderboard-list-by-user-ids-is-returning-global-records-instead/300/5 "2019-10-26T13:02:55Z")

</div>

That’s definitely good design and I might use that in the future so I’m glad it’s an option 😃
