Looking for some guidance here on how can I extract Alok,Test and Test2
Object {value: "{"actors":["Alok","Test","Test2"]}"}
I have almost spent entire day to figure out the way to parse this JSON array but closest I reached is getting all characters printed in a single line.
My javascript implementation is:
AJS.$.ajax({
dataType: 'json',
type: 'GET',
url: AJS.params.baseURL+"/rest/leangearsrestresource/1.0/message/list/{actor}",
async: false,
multiple: true
}).done(function(result) {
AJS.log(result);
//var obj = JSON.parse(result);
//AJS.log(obj.actors[1]);
//AJS.log("Actor is " + result.length);
var output = '';
for(var key in result) {
AJS.log("Key: " + key + " value: " + result[key]);
var myThing = result[key];
var output = myThing.property
AJS.log(output)
// AJS.log(output.text)
for( thingKey in myThing ) {
AJS.log(myThing[thingKey])
}
}
Also attaching the console screenshot
dataType: 'json'in the request orresult = JSON.parse( result );in the callback. You currently just get a string and you should parse it before using it.