This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createHtmlOutputFromFile('form.html'); | |
} | |
function uploadFiles(form) { | |
try { | |
var dropbox = "xxx"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ss = SpreadsheetApp.getActiveSpreadsheet() | |
var form = ss.getSheetByName('แผ่น1') | |
var data = ss.getSheetByName('แผ่น2') | |
function Submit() { | |
var values = [[form.getRange("B6").getValue(), | |
form.getRange("B8").getValue(), | |
form.getRange("B10").getValue(), | |
form.getRange("D6").getValue(), | |
form.getRange("D8").getValue(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createTemplateFromFile("index").evaluate() | |
} | |
function userClick(data) { | |
let ss = SpreadsheetApp.openById('xxx'); | |
let sheet = ss.getSheets()[0]; | |
let response = Maps.newGeocoder().reverseGeocode(data.lat, data.lon); | |
let geoAddress = response.results[0].formatted_address; | |
sheet.appendRow([data.username,Utilities.formatDate(new Date(), "GMT+7", "MM/dd/yyyy HH:mm:ss"), `${data.lat},${data.lon}`, geoAddress]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createTemplateFromFile("index").evaluate() | |
} | |
function userClick(data) { | |
let ss = SpreadsheetApp.openById('xxx'); | |
let sheet = ss.getSheets()[0]; | |
let response = Maps.newGeocoder().reverseGeocode(data.lat, data.lon); | |
let geoAddress = response.results[0].formatted_address; | |
sheet.appendRow([data.username,Utilities.formatDate(new Date(), "GMT+7", "MM/dd/yyyy HH:mm:ss"), `${data.lat},${data.lon}`, geoAddress]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createTemplateFromFile("form").evaluate() | |
.setTitle("ฟอร์มอัปโหลดงานส่งครูอภิวัฒน์") | |
.addMetaTag('viewport', 'width=device-width, initial-scale=1') | |
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); | |
} | |
var url = "xxx"; | |
var folderId = "xxx"; | |
var ss = SpreadsheetApp.openByUrl(url); | |
var sheet = ss.getSheets()[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const PARENT_FOLDER_ID = "1_VyAmlhdZwcnb0iefewY1vPp71hIz4nP"; | |
const initialize = () => { | |
const form = FormApp.getActiveForm(); | |
ScriptApp.newTrigger("onFormSubmit").forForm(form).onFormSubmit().create(); | |
}; | |
const onFormSubmit = ({ response } = {}) => { | |
try { | |
// Get a list of all files uploaded with the response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit() { | |
var ss = SpreadsheetApp.openById('xxx')// ***ใส่ sheet id*** | |
var lastRow = ss.getLastRow() | |
var score = ss.getRange('B' + lastRow).getValue() | |
var form = FormApp.openById('xxx'); // ***ใส่ form id*** | |
var fRes = form.getResponses(); | |
var formResponse = fRes[fRes.length - 1]; | |
var itemResponses = formResponse.getItemResponses(); | |
var msg = '📣ผลการสอบเก็บคะแนน วิชาครูอภิวัฒน์ ';//+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit() { | |
var form = FormApp.openById('xxx'); // ***ใส่ form id*** | |
var fRes = form.getResponses(); | |
var formResponse = fRes[fRes.length - 1]; | |
var itemResponses = formResponse.getItemResponses(); | |
var msg = '📣นักเรียนส่งงานครูอภิวัฒน์ '; | |
msg += ' \n' + itemResponses[0].getItem().getTitle() + ': ' + itemResponses[0].getResponse() + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myFunction() { | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var sheet = ss.getSheetByName('ทำรายการ');//แผ่นงาน ทำรายการ | |
var data = sheet.getRange(2, 2, 1, 3).getValues()[0]; //ดึงข้อมูลเมื่อทำรายการ | |
var sheetName = sheet.getRange('A2').getValue()//ดึงชื่อผู้ทำรายการ จากแถว 2 คอลัมน์ 1 | |
var sheetNew = ss.getSheetByName(sheetName);//เอาชื่อที่ได้ไปอ้างอิงกับชีต | |
sheetNew.appendRow(data);//เพิ่มข้อมูลใส่เข้าไปในชีตนั้น | |
sheet.deleteRow(2);//ลบข้อมูลที่รับเข้ามาจากชีตทำรายการทิ้งไป |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(e) { | |
return HtmlService.createTemplateFromFile("index").evaluate() | |
.setTitle("ระบบค้นหาข้อมูล") | |
.addMetaTag('viewport', 'width=device-width, initial-scale=1') | |
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); | |
} | |
function processForm(formObject){ | |
var concat = formObject.searchtext+formObject.searchtext2; |