question

element808 avatar image
element808 asked

Player Data (Title) Update JSON Data in UE4 Blueprints

I'm trying to update a specific JSON object in my Player Data (Title) via the "Update User Data" blueprint node in UE4.

My current key/value pair looks like this:

Key: Avatar
Value: {"Gender":"Male","HairColor":"HairColor1","SkinColor":"SkinColor3"}

Every time I try to set something with the "Update User Data" node, such as SkinColor, it removes all other JSON Object strings other than the one I'm updating, and turns my key/value pair into the following:

Key: Avatar
Value: {"SkinColor":"SkinColor3"}

As you can see, it removes my Gender and HairColor values from my Avatar JSON object.

Could I get some guidance on how I can achieve this, using PlayFab blueprint nodes? Thanks in advance!

Player Dataunreal
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

In fact, this behavior is intended because PlayFab will always overwrite the previous value with the new value when you try to update data.

The work around solution is to get the current value of “Avatar” first, then craft a new structured JSON for “Avatar” with the value updated and you may call the UpdateUserData API after that.

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.

element808 avatar image element808 commented ·

@SethDu - mahalo for the answer. Just wanted to make sure I wasn't doing something wrong, and get the official answer. Ended up expanding on this and and storing all avatar data in a single structure and pushing it all up to PlayFab at once.

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.