question

Larry Dietz avatar image
Larry Dietz asked

*EDIT* use a string for a keyname in userdata

*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

Player DataCloudScript
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

·
Seth Du avatar image
Seth Du answered

Thanks for the follow up. I will mark this thread as solved.

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.