question

Sai Teja avatar image
Sai Teja asked

How to get the player display name from entity Id.

I am trying to display the members in the group with their names. I am getting the entity id of the members in the group. How to get the display names from the entity id.

If I can get playfab id also from enetity id, display name can be fetched.

Thanks in advance.

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

You can get the members’ PlayFabIds in the response of the ListGroupMembers. The Id of master_player_account is the player’s PlayFabId. Then you can call the API GetAccountInfo or GetPlayerProfile to retrieve the player’s DisplayName. Besides, as this thread -- https://community.playfab.com/questions/19583/finding-display-names-of-members-of-an-entity-grou.html mentioned, we don’t suggest to loop the entire list and query the data for each member. You can consider getting the players’ account info by page and cache the info for subsequent use.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Chuck avatar image Chuck commented ·

It's slightly frustrating because the Groups API is sooo nearly a solution, but is missing 2+ features:
#1 This... fetch display names of Members (efficiently in 1 api call)
#2 List/Enumerate/Search for Groups

So... We've punted to a custom game service/api to solve both. Just moving the whole group/clan implementation to our own service would be simpler than coordinating an implementation split across two APIs. Something like leaving a clan involves multiple steps: is the player in a clan? what clan? as the only member? if so, delete the group. If not, are they the leader? If so, promote someone else in to role. Now, leave the group. Awkward when the implementation is half PlayFab and half our own service... Just to support 1 & 2.

It's also slightly frustrating because in the case of Group Names, they're just human-friendly 1-1 mappings to the Group entity Id. They don't add anything to the API consumer, if the (unique) Group Entity ID just WAS the (unique) Group Name, I wouldn't need to look it up for every group enumerated in a list. If the group names did not have a uniqueness requirement the names would add value.. But that's #3 for us, support non-unique group names :/.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.