question

odditydeveloper avatar image
odditydeveloper asked

Copy player data (title) key/value pair to player statistics

I have a certain key/value pair stored under player data (title). I want to move this key/value pair to statistics so Playfab can aggregate things for me. Is there an inbuilt tool to do this, or a way for me to move every players' data to statistics via cloudscript?

Leaderboards and Statistics
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

·
JayZuo avatar image
JayZuo answered

There is no built-in tool to do this, but you can use PlayFab Server API to build such as tool. You can use GetPlayersInSegment and use the "All Players" segment to get all players and then for each user use GetUserData and UpdatePlayerStatistics to move player data key/value pair to statistics.

Another way would be using Bulk Actions, you can check the Run Cloud Script for each player section. In the cloudscript, you can still use GetUserData and UpdatePlayerStatistics, then create a new task like in the document to execute your cloudscript function against every player.

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.

odditydeveloper avatar image odditydeveloper commented ·

let me take a look at this. Thanks!

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.