How are able to get json array inside ue4 bp , Getting function get field as string returns entire json as string to me but i kinda need to parse json array which is ResultData .
May I know how did you set up the BP? Maybe some screenshots of that?
Answer by Citrus Yan · Nov 23, 2020 at 08:14 AM
I believe you should use the "Get Object Array Field" node to get the "ResultData" as a array:
Answer by Geo · Nov 23, 2020 at 01:23 AM
I just already put the ss while creating the topic but yeah something went wrong i guess.
This is my title Data
{
"ResultData": [
{
"Server_ID": "0",
"Server_Name": "Asgardia",
"Server_IP": "127.0.0.1",
"Server_Port": "7777"
},
{
"Server_ID": "1",
"Server_Name": "Leonard",
"Server_IP": "127.0.0.1",
"Server_Port": "7777"
}
]
}
CloudScript Result:
{ "FunctionResult": { "obj": { "ServerInformation": "{\"ResultData\":[{\"Server_ID\":\"0\",\"Server_Name\":\"Asgardia\",\"Server_IP\":\"127.0.0.1\",\"Server_Port\":\"7777\"},{\"Server_ID\":\"1\",\"Server_Name\":\"Leonard\",\"Server_IP\":\"127.0.0.1\",\"Server_Port\":\"7777\"}]}" } }, "Logs": [], "ExecutionTimeSeconds": 0.0303603, "MemoryConsumedBytes": 12248, "APIRequestsIssued": 1, "HttpRequestsIssued": 0, "Error": null }
CloudScript Revision Js Code
handlers.TestRequest = function (args,context) {
var data = args.titleName;
var value = server.GetTitleData({
Keys : [data]
});
// log.info(value);
// log.info(value.Data[data]);
//return {"Value" : value.Data[data]};
// return JSON.parse(JSON.stringify(value.Data[data]));
var obj = value.Data;
return {obj};
};
Answer by Geo · Dec 15, 2020 at 01:32 AM
handlers.GetServerInformationTitleData = function (args,context) {
var data = args.titleName;
var value = server.GetTitleData({
Keys : [data]
});
return JSON.parse(value.Data[data]); /// this does the fix cuz return object was not coming as an array it was like string .
};
Invalid Receipt Response to Validate Google Play Purchase with Unreal Blueprints 1 Answer
UE4 Blueprint and C++ Co-Operation 1 Answer
How can a client launch their game server via "Server 2.0" with custom settings? 1 Answer
Unreal Playfab Multiplayer,Unreal Multiplayer Playfab 1 Answer
Having trouble with Get content from CDN to Update my game's version in Unreal Engine 4 0 Answers