Cara Input Google Form ke Banyak Spreadsheet Sekaligus
*Untuk Mendapatkan Full Script tanpa password silahkan Klik Disini*
1. Buatlah Google Form
2. Buatlah beberapa Spreadsheet sebagai database hasil dari input Google Form.
Sesuaikan tabel data dengan Google Form.
Tambahkan kolom Date pada akhir kolom.
(Perhatikan gambar dibawah ini)
3. Kembali pada Google Form, klik titik tiga di pojok kanan atas, pilih "Editor skrip".
4. Copy dan pastekan script di bawah ini ke Code.gs
Masukkan Password Untuk Melihat Script (Password ada di dalam video)
//Copyright www.javabitpro.com
//Youtube : javabitpro
function onFormSubmit(event) {
record_array = []
var form = FormApp.openById('1IKAZBqiatB9cjbZ_V6z8lbGA2jUgNSsUAEO3WvnDWoY'); // Form ID
var formResponses = form.getResponses();
var formCount = formResponses.length;
var formResponse = formResponses[formCount - 1];
var itemResponses = formResponse.getItemResponses();
for (var j = 0; j < itemResponses.length; j++) {
var itemResponse = itemResponses[j];
var title = itemResponse.getItem().getTitle();
var answer = itemResponse.getResponse();
Logger.log(title);
Logger.log(answer);
record_array.push(answer);
}
AddRecord(record_array[0], record_array[1], record_array[2],record_array[3]);
AddRecord1(record_array[0], record_array[1], record_array[2],record_array[3]);
}
function AddRecord(Nama_Depan, Nama_Belakang, Umur,village) {
var url = 'https://docs.google.com/spreadsheets/d/1xOTMpFoHajnwCfN9Rb4XhD8aRPES69hm0wv6K8gzgy4/edit#gid=0'; //URL OF GOOGLE SHEET;
var ss= SpreadsheetApp.openByUrl(url);
var dataSheet = ss.getSheetByName("Sheet1");
dataSheet.appendRow([Nama_Depan, Nama_Belakang, Umur,village, new Date()]);
}
function AddRecord1(Nama_Depan, Nama_Belakang, Umur,village) {
var url = 'https://docs.google.com/spreadsheets/d/1EE9Sp-yrW9S-bNYLD0LE6QSB085GPSnCGG5CLCqT-us/edit#gid=0'; //URL OF GOOGLE SHEET;
var ss= SpreadsheetApp.openByUrl(url);
var dataSheet = ss.getSheetByName("Sheet1");
dataSheet.appendRow([Nama_Depan, Nama_Belakang, Umur,village, new Date()]);
}
//Copyright www.javabitpro.com //Youtube : javabitpro function onFormSubmit(event) { record_array = [] var form = FormApp.openById('1IKAZBqiatB9cjbZ_V6z8lbGA2jUgNSsUAEO3WvnDWoY'); // Form ID var formResponses = form.getResponses(); var formCount = formResponses.length; var formResponse = formResponses[formCount - 1]; var itemResponses = formResponse.getItemResponses(); for (var j = 0; j < itemResponses.length; j++) { var itemResponse = itemResponses[j]; var title = itemResponse.getItem().getTitle(); var answer = itemResponse.getResponse(); Logger.log(title); Logger.log(answer); record_array.push(answer); } AddRecord(record_array[0], record_array[1], record_array[2],record_array[3]); AddRecord1(record_array[0], record_array[1], record_array[2],record_array[3]); } function AddRecord(Nama_Depan, Nama_Belakang, Umur,village) { var url = 'https://docs.google.com/spreadsheets/d/1xOTMpFoHajnwCfN9Rb4XhD8aRPES69hm0wv6K8gzgy4/edit#gid=0'; //URL OF GOOGLE SHEET; var ss= SpreadsheetApp.openByUrl(url); var dataSheet = ss.getSheetByName("Sheet1"); dataSheet.appendRow([Nama_Depan, Nama_Belakang, Umur,village, new Date()]); } function AddRecord1(Nama_Depan, Nama_Belakang, Umur,village) { var url = 'https://docs.google.com/spreadsheets/d/1EE9Sp-yrW9S-bNYLD0LE6QSB085GPSnCGG5CLCqT-us/edit#gid=0'; //URL OF GOOGLE SHEET; var ss= SpreadsheetApp.openByUrl(url); var dataSheet = ss.getSheetByName("Sheet1"); dataSheet.appendRow([Nama_Depan, Nama_Belakang, Umur,village, new Date()]); }
5. Sesuaikan ID Google Form kalian.
6. Sesuaikan ID Spreadsheet kalian
7. Klik ikon Save.
8. Klik menu Trigger / Pemicu - lalu klik tombol Add Trigger / Tambhakan Pemicu.
9. Samakan pengaturan dengan gambar di bawah ini - lalu Save.
10. Silahkan lakukan inputan pada Google Form
SELESAI!