question

Kim Strasser avatar image
Kim Strasser asked

How can I delete a UserInternalData key/value pair with code?

I want to delete a certain UserInternalData key/value pair after client API AddUsernamePassword was executed in my Azure function. How can I do that?

Is it possible to delete the key/value pair automatically in the Azure function or is it necessary to delete it manually in Game Manager?

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

·
Citrus Yan avatar image
Citrus Yan answered

You can use UpdateUserInternalData to delete certain key/value pairs by specifying which keys to remove using the “KeysToRemove” property:

{
"PlayFabId": "xxxx",

"KeysToRemove": [

"keyname1"
]
}

Or, just set the value as null for keys that you want to delete:

{
  "PlayFabId": "xxxx",
  "Data": {
    "keyname1": null
  }
}

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.