This is an old revision of the document!


Webex Connect JavaSscript Examples

Retrieve Google Sheets worksheet- example:

Then set the response Code and Response Body as variables when leaving the HTTP node - as per below.

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++) {
        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;
}
  • vendors/cisco/uc/webconnect/js.1731840637.txt.gz
  • Last modified: 2024/11/17 10:50
  • by gerardorourke