I have this key/value pair in user data:
Key: Myjson Value: {"Id":"1","Timestamp":"23.12.2020 10:30:00","Day":"Wednesday","Month":"December","Year":"2020"}
And I want to create an array with all the item keys of this json. But I don't know how to get the item keys from result:
var jsonitemskeys = []; var result = server.GetUserData({PlayFabId: currentPlayerId, Keys: "Myjson"}); if ((result.Data.hasOwnProperty("Myjson")) && (result.Data.Myjson.Value != "") && (result.Data.Myjson.Value != null)) { // Add the item keys to the array }
I want to add the keys "Id", "Timestamp", "Day", "Month" and "Year" to the array jsonitemskeys = [] but I don't know how to do that in this case. How can I add the keys to the array?