question

Saphal Aryal avatar image
Saphal Aryal asked

Update Player User Data VS Update Player Title Data

1 . What is the difference between Update Player User Data And Update Player Title Data ?

2. For what types of data Update Player User Data should be used and similarly for what types of data Update Player Title Data should be used ?

Also Another Question ,

When Setting User Data there is given a dictionary named (Data).sometime I want to update value of only one key named ("Level" or "Experience" or "Selected Character " etc). How can I do this?

Player DataTitle Data
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

·
Rick Chen avatar image
Rick Chen answered

The Player user data is the Player title data, there is no difference. Did you mean the difference between the Player title data and the Player publisher data? The Player title data allows the players to read/write data in a specific title, while the Player publisher data can be shared across titles within a studio. For the data that only make sense in a title, you can save it in the Player title data, such as the player’s level/experience in a game. For the data that matters across your titles, you can put it in the Player publisher data, such as some achievements that the players can use to redeem rewards in your other titles. You may refer to this document for more detail: How to use player publisher data to grant a reward for playing multiple titles - PlayFab | Microsoft Docs.

>>When Setting User Data there is given a dictionary named (Data).sometime I want to update value of only one key named ("Level" or "Experience" or "Selected Character " etc). How can I do this?

Do you mean using the UpdateUserData API? Whichever key/value pair you want to update, you can just put that in the request body. Here is an request body example of the UpdateUserData API, which will only update the level:

{

"Data": {

" Level ": "5"

}

}

2 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.

Saphal Aryal avatar image Saphal Aryal commented ·
@Rick Chen

I tried using this code but shows me many errors . Is this Correct way to update value of only one key

public void SetTitleData()
    {
        var request = new UpdateUserDataRequest()
        {
		"Data": {
		" Level ": "5"}
	}

    }
0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Saphal Aryal commented ·

If you are using Unity, please follow this quick tutorial and learn how to make API calls in Unity: Unity3D quickstart - PlayFab | Microsoft Docs.

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.