I am attempting to get a value from an array with a for loop and insert it into a JSON url. Here is the code.
myConnector.getData = function(table, doneCallback) {
datasetWebId.forEach(function(v) {
var webId = (v);
$.getJSON("https://www.twdc/api/" + webId + "/recorded?starttime=*-3d&endtime=*", function(resp) {
tableData = [];
resp.Items.forEach(function(item) {
item.Items.forEach(function(subItem) {
tableData.push({
'name': item.Name,
'Timestamp': subItem.Timestamp,
'Value': subItem.Value,
'Path': item.Path
});
});
});
});
table.appendRows(tableData);
doneCallback();
});
};
When it runs it hits the first loop and just skips the rest. There is values in datasetWebId array, so that is no the issue. Can someone spot something out of place?