Skip to content

Instantly share code, notes, and snippets.

@miftahafina
miftahafina / Code.gs
Last active August 7, 2023 06:28
Integrasi WhatsApp dengan Google Forms dan Google Sheets - Full tutorial: https://www.youtube.com/watch?v=fZ1-seZFrSc
function SendMessage(nomor_wa, pesan)
{
var url = 'https://pati.wablas.com/api/v2/send-message';
var token = 'YOUR_SECURITY_TOKEN_HERE';
var headers = {
'Authorization' : token,
'content-type' : 'application/json',
};
@miftahafina
miftahafina / PendaftaranOnline.gs
Last active November 8, 2024 05:37
Input Data dari WhatsApp ke Google Sheet - Full Tutorial: https://youtu.be/UOpdL3wrivg
function doPost(e) {
// Buka sheet
let sheetUrl = "YOUR_SHEET_URL";
let file = SpreadsheetApp.openByUrl(sheetUrl);
let sheet = file.getSheetByName("Sheet1");
// Rapikan data
let req = JSON.stringify(e).replace(/\\/g, "").replace("}\"", "}").replace("\"{", "{");
let reqJson = JSON.parse(req);
let senderMessage = JSON.stringify(reqJson["postData"]["contents"]["senderMessage"]);
@miftahafina
miftahafina / CekNilai.gs
Created December 8, 2022 11:29
Mengambil Data dari Google Sheets Melalui WhatsApp - Full Tutorial https://youtu.be/WPNbvc6lj3U
function cekNilai(nis) {
// Buka sheet
let sheetUrl = "URL_GOOGLE_SHEETS";
let file = SpreadsheetApp.openByUrl(sheetUrl);
let sheet = file.getSheetByName("Sheet1");
let last_row = sheet.getLastRow();
// Ambil data
let nilai_list = sheet.getRange(`A2:C${last_row}`).getValues();
let nilai_filtered = nilai_list.filter(el => el[0] == nis);