question

Denzie Gray avatar image
Denzie Gray asked

CloudScript Error in Player Dashboard

@Brendan

When I run the CloudScript function from the Player dashboard I used to get the resulting JSON object.
However today I am just getting TONS of empty arrays in the return. Is CS undergoing maintenance?

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.

Rick Chen avatar image
Rick Chen answered

@Denzie Gray

Here is an update that the issue has been fixed. According to my test, executing CloudScript on [Player]->[CloudScript] page returned the result correctly. Please try again and let me know if the issue still exists.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image
Rick Chen answered

This could be a known issue. You mentioned that you used to get the resulting JSON object, when was that time? To work around, you could use the Postman to call the ExecuteCloudScript API, which should return the proper data according to my test. Please note that it is not efficient to run the CloudScript from the Player Dashboard, it is recommended to use the Postman to call your CloudScript instead.

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Denzie Gray avatar image Denzie Gray commented ·

@Rick Chen

It was a 2 weeks ago. I was able to get "Function Result: " to print the results my methods returned. This allowed me to proto-type far faster than Postman since I could jump between players and test via the dev portal.

0 Likes 0 ·
Denzie Gray avatar image Denzie Gray commented ·

Here's what a result looks like:

JSON object has

2 fields that are a number and string.
{"Result" : 0, "Message" : 'Hello World' }

{

    "FunctionResult": [
        [
            []
        ],
        [
            []
        ]
    ],
    "Logs": [],
    "ExecutionTimeSeconds": 0.0004885,
    "MemoryConsumedBytes": 1880,
    "APIRequestsIssued": 0,
    "HttpRequestsIssued": 0,
    "Error": null
}
0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Denzie Gray commented ·

Could you try using the log.info() to print the results in "Logs" instead in your CloudScript?

0 Likes 0 ·
Denzie Gray avatar image Denzie Gray Rick Chen ♦ commented ·

@Rick Chen

I get this:


{

    "FunctionResult": [
        [
            []
        ],
        [
            []
        ]
    ],
    "Logs": [
        {
            "Level": "Info",
            "Message": "{\"ResultCode\":0,\"Message\":\"Hello World\"}",
            "Data": null
        }
    ],
    "ExecutionTimeSeconds": 0.000431,
    "MemoryConsumedBytes": 2584,
    "APIRequestsIssued": 0,
    "HttpRequestsIssued": 0,
    "Error": null
}
0 Likes 0 ·
Show more comments
Show more comments
Rick Chen avatar image Rick Chen ♦ Denzie Gray commented ·

Sorry for the inconvenience. The prioritization on this issue is based on a combination of severity and feedback. This issue may not have a high priority and we don't have ETA on when it will be fixed. If there is significant impact caused by this issue, you could let us know and I will report to the corresponding team and they may raise the priority on fixing this issue. Thanks for your understanding.

0 Likes 0 ·

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.