Hi,
The structure I'm working with is shown in attachment which is what is returned from my PHP script.It is a large string "data". This is converted to an object "obj"with up to 80 elements each of which an array ?? obj of 15 elements.
As you see below" alert(records[0].Company);" returns the data properly.
PROBLEM: " alert(records[0].x); " returns undefined I'm trying to iterate each records 15 elements to use in a table. Is there an easier way to do this???
Code:
function viewCompanyRecords(data) {
const obj = JSON.parse(data);
const records=Object.values(obj);
const myindex=Object.keys(records[0]);
alert("myindex[3]: "+myindex[3]+"Type is: "+typeof myindex[3]); = myindex[3]: Company Type is: string
var x=myindex[3];
alert(records[0].Company); = Apple Mini Ipad - There are 14 other elements in the array to show for each of 80 records.
alert(records[0].x); = undefined
}