question

contrejo27 avatar image
contrejo27 asked

setobjects only creates part of the object

I'm setting an object with 2 values but it ends up only getting one. In the group object when I check it just has {"playersInTournament": 0} instead of

            { "amount" : tournamentAmount,
            "playersInTournament": 0
        };

Here is the code I am using.

        var tournamentInfo = {
            "amount" : tournamentAmount,
            "playersInTournament": 0
        };
    
        // set info like current round and max players (amount)
        var setObjectResult = entity.SetObjects({
            Entity: tournament,
            Objects: [
                {
                    ObjectName: "TournamentInfo",
                    DataObject: tournamentInfo
                }
            ]
        });
entitiesShared Group Data
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

·
Rick Chen avatar image
Rick Chen answered

I cannot reproduce this issue. What was the value of the “tournamentAmount” variable in your line 2? Did you call the SetObjects somewhere else where the DataObject is {"playersInTournament": 0}? To prevent unexpect update from SetObjects API, you can set the "ExpectedProfileVersion" in the request body. Could you reproduce this issue with the "ExpectedProfileVersion" set?

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.