Hello,
I'm using the script described below to import data from a smartsheet report into a google sheet tab. When using the sheets portion from the URL G-sheet will comfortably import all rows. However, when I change to reports, the script will continue to stop at 101 rows. I've tried sorting rows, minimizing row count.
I used this in google's app script editor:
var smartSheetToken = "xxxxx";
var smartSheetID = "xxxxxx";
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("SS Import");
var url = "https://api.smartsheet.com/2.0/reports/" + smartSheetID;
var response = UrlFetchApp.fetch(
url, { headers: {Authorization: 'Bearer ' + smartSheetToken}}
);
var result = JSON.parse(response.getContentText());
sheet.clear();
var tab = [];
for (var column in result.columns){
var value = result.columns[column]["title"];
tab.push(value);
}
sheet.appendRow(tab);
for(var row in result.rows){
var cells = result.rows[row]["cells"];
var tab = [];
for(var cell in cells){
var value = cells[cell]["value"] == undefined ? "" : cells[cell]["value"];
tab.push(value);
}
sheet.appendRow(tab);
}
}