*EDIT* I am trying to construct a key name as a string variable, then use that variable as the keyname for userdata, in cloudscript.
Here is what I tried...
var Key = "Test" + currentPlayerId; server.UpdateUserData({ "PlayFabID": ReferralID, "Data": { Key: "Test Message" } });
What I expected was an entry in userdata with a key of Test with the currentPlayerID appended, i.e. TestEC0C69CD034FAF47 with a value of "Test Message"
What I got was a a key of "Key" with a value of "Test Message"
Any idea what I am doing wrong here?
Thanks,
-Larry
*UPDATE*
Nevermind. After much searching, I finally found the following that explained how to do this...
https://community.playfab.com/questions/496/206963508-Writing-to-a-dynamic-Key-in-Cloud-Script.html