Skip to content

Instantly share code, notes, and snippets.

@huynguyennovem
Last active November 28, 2022 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huynguyennovem/19a960ce3dd4b7a711c0441386d59b17 to your computer and use it in GitHub Desktop.
Save huynguyennovem/19a960ce3dd4b7a711c0441386d59b17 to your computer and use it in GitHub Desktop.
Google codelabs tool App script
function doGet(request) {
var sheet = SpreadsheetApp.openById("1bzuFEiI9Sh3fT_nY84b2JdTqzhpVHkU00VKsVhKOr4U");
var values = sheet.getActiveSheet().getDataRange().getValues();
var data = [];
for (var i = 1; i < values.length; i++) {
var row = values[i];
var datas = {};
datas['Timestamp'] = row[0];
datas['Your email'] = row[1];
datas['Joined codelab'] = row[2];
datas['How to get a certificate'] = row[3];
datas['Link public profile'] = row[4];
data.push(datas);
}
return ContentService.createTextOutput(JSON.stringify(data)).setMimeType(ContentService.MimeType.JSON);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment