How to map loop in loop for array in array response function



How do I map this so that i can return all of the cells and attributes located in the red rectangle only as local variable.

I tried custom script like below, but some of it is obviously wrong.


Apperyio.get("servicename")(requestData).then(
function(success){ // success callback
(function mapping9359(success, $scope){
var TBLineList_scope = $scope.TBLineList;
for (var i = 0, l = success.data.Reports.length; i < l; i++) {

for (var t = 1, y = success.data.Reports[i].Rows.length; t < y; t++) {

for (var w = 0, q = success.data.Reports[i].Rows[t].Rows.length; w < q; w++) {

for (var b = 0, d = success.data.Reports[i].Rows[t].Rows[w].Cells.length; b < d; b++) {

for (var c = 0, e = success.data.Reports[i].Rows[t].Rows[w].Cells[b].Attributes.length; c < e; c++) {
_.set(TBLineList_scope, '[' + c + '].Value', success.data.Reports[i].Rows[t].Rows[w].Cells[b].Value);
_.set(TBLineList_scope, '[' + c + '].Account', success.data.Reports[i].Rows[t].Rows[w].Cells[b].Attributes[c].Value);
_.set(TBLineList_scope, '[' + c + '].Id', success.data.Reports[i].Rows[t].Rows[w].Cells[b].Attributes[c].Id);
}

}

}

}

}
1 person has
this question
+1
Reply