question

steelfox001 avatar image
steelfox001 asked

CloudScript Using Variable for UpdateUserDate

Hi, how can i use variable to update UserDate, in my way it use key "playerUserName" but i expect it use var playerUserName.

handlers.AddPlayerToAff = function(args, context){

var affPlayFabId=args.affPlayFbId;

var playerUserName = args.PlayerUserName;

var updateUserDataResult = server.UpdateUserData({

PlayFabId: affPlayFabId,

Data: {

playerUserName: currentPlayerId

} });

return ;

}

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

·
brendan avatar image
brendan answered

Please see this post for complete info on how to dynamically define your Key for a data update call: https://community.playfab.com/questions/83/205460148-Cloud-Script-how-do-I-write-data-to-a-Key-which-is-defined-dynamically.html.

10 |1200

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

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.