I'm trying to write an Admin routine to add a new key and value to 'some' users (specifically top 100 on our leaderboard).
All indicators, clouscript logs in the PlayStream, return values show everything to be ok, bu the key is not getting added at all.
This is my cloud script (I've got rid of irrelevent stuff):
handlers.setPrizes = function (args, context){
var id = args.playFabID;
var prizes = args.prizes;
log.info("id: " + id + ", prizes: " + prizes);
try{
server.UpdateUserData({ "PlayFabId" : id, "Data" : [{ "prizes" : prizes }] });
}catch (ex){
..stuff..
};
The arg.PlayfabID is correct as to the user that I want to add this key to
args.prizes is a string, not an object and looks like this: {\"MaskPrizes\":{\"MaskIndex\":13,\"Owned\":[13,12,11]}}
The log in the playstream looks thus: ( Have ?? out the characters of the playfab user id)
"Logs": [ { "Level": "Info", "Message": "id: E2D3?????????, prizes: {\"MaskPrizes\":{\"MaskIndex\":13,\"Owned\":[13,12,11]}}", "Data": null },
As there are no errors and it all looks ok, I'm at a loss :(