question

Thong Nguyen avatar image
Thong Nguyen asked

Saving and Updating list in PlayerTitle

Hi, I'm getting to learn PlayFab, and what I'm using this code to do get player read-only data and then modify it and then save it back.

handlers.UpdatePlayerLevelDetail = function (args, context){
    let data = server.GetUserReadOnlyData({
       PlayFabId: currentPlayerId, Keys: ["userEachLevelScore", "userEachLevelStar"]
    });
    log.debug("data", data);
    // add more value 
    // update new value
    return {"data": data};
}

The data in log.debug is empty but data is not empty in return.

here is my read-only data

Does it mean that I have to change data on client and then just call the update function on server?

Player Data
capture.png (21.4 KiB)
capture.png (23.1 KiB)
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

·
Seth Du avatar image
Seth Du answered

What's your Title ID? I have tested your code and it looks fine.


3 comments
10 |1200

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

Thong Nguyen avatar image Thong Nguyen commented ·

My Title ID is AC463

0 Likes 0 ·
Thong Nguyen avatar image Thong Nguyen commented ·

I've just tested again, it works on Unity but not work when calling on cloud script

0 Likes 0 ·
capture.png (47.9 KiB)
Seth Du avatar image Seth Du ♦ Thong Nguyen commented ·

This should be a display issue on Cloud Script tab of Player Account page. I will inform our team and file a bug. The work around solution is temporarily using other methods/tools to test Cloud Script, for example, Postman.

1 Like 1 ·

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.