question

Jeffrey Campbell avatar image
Jeffrey Campbell asked

Having trouble updating User CustomData using UpdateUserData via cloudscript. Please help asap

 handlers.updateUserData = function (args, context) {
    
         var UpdateUserDataRequest = {
             "PlayFabId": args.playFabId,
             "Data": {
                "isTeamMember": JSON.stringify(args.data["isTeamMember"]),
                 "GroupID": JSON.stringify(args.data["GroupID"])
             }
         };
         server.UpdateUserData(UpdateUserDataRequest);
 }
CloudScript
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

·
Neils Shi avatar image
Neils Shi answered

I tested your code and it works fine on my title. It looks like you made a mistake when calling ExecuteCloudScript. You can refer to my request body:

 {
   "FunctionName": "updateUserData",
   "FunctionParameter": {
     "playFabId":" ",
     "data":{
     "isTeamMember":"true",
     "GroupID":"54321"}
   },
   "RevisionSelection": "Live",
   "GeneratePlayStreamEvent": true
 }
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.