Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Created July 4, 2020 07:49
Show Gist options
  • Select an option

  • Save PatilShreyas/27c2c784ab8e984f406f02837a25869e to your computer and use it in GitHub Desktop.

Select an option

Save PatilShreyas/27c2c784ab8e984f406f02837a25869e to your computer and use it in GitHub Desktop.
function doGet(request){
// Open Google Sheet using ID
var sheet = SpreadsheetApp.openById("1OOArrqjOqmD4GiJOWlluZ4woTMH_qaV6RKv4JXnT3Hk");
// Get all values in active sheet
var values = sheet.getActiveSheet().getDataRange().getValues();
var data = [];
// Iterate values in descending order
for (var i = values.length - 1; i >= 0; i--) {
// Get each row
var row = values[i];
// Create object
var feedback = {};
feedback['name'] = row[0];
feedback['email'] = row[1];
feedback['mobile_no'] = row[2];
feedback['feedback'] = row[3];
// Push each row object in data
data.push(feedback);
}
// Return result
return ContentService
.createTextOutput(JSON.stringify(data))
.setMimeType(ContentService.MimeType.JSON);
}
@KroSign
Copy link

KroSign commented Dec 14, 2025

vradar this is so tuff vraddar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment