Skip to content

Instantly share code, notes, and snippets.

@fromkk
Created February 13, 2021 11:06
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 fromkk/0571bd55a923105bf16ec124b94de8a3 to your computer and use it in GitHub Desktop.
Save fromkk/0571bd55a923105bf16ec124b94de8a3 to your computer and use it in GitHub Desktop.
SMSのコードを返すGAS
function doGet() {
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const sheet = spreadsheet.getActiveSheet();
const range = sheet.getRange("A2");
const value = ('000000' + range.getValue()).slice(-6);
const out = ContentService.createTextOutput();
out.setMimeType(ContentService.MimeType.JSON);
out.setContent(JSON.stringify({"code": value}));
return out;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment