This is an old revision of the document!
Webex Connect JavaSscript Examples
if (statusCode == 200) { const data = JSON.parse(responseBody); const inputArray = data["values"]; const headers = inputArray[0]; const rows = inputArray.slice(1); const output = []; //for (let i = 0; i < rows.length; i++) { for (let i = 0; i < 2; i++) { let rowObject = {}; // Create a new object for each row - note 'const' should work here - but didn't. Platform using old JS? for (let j = 0; j < headers.length; j++) { rowObject[headers[j]] = rows[i][j]; } output.push(rowObject); // Push the new object to the output array } myheaders = headers.toString(); myrows = rows.toString(); myoutput = output; customersJSON = JSON.stringify(output); 1; } else { 2; }