AppSScript Code Copy Code function onOpen() { var ui = SpreadsheetApp.getUi(); // Add a custom menu to the spreadsheet ui.createMenu('Bulk Message') .addItem('Generate Bulk Message', 'createWhatsAppHyperlink') // Add menu item .addToUi(); // Attach menu to the UI } function createWhatsAppHyperlink()...
AppSScript Code Copy Code function createBackup() { // Get the active spreadsheet var spreadsheet = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/1cdLeAOOVQyYYtjoMViEWr-8RW6yEdhfNjLynCsdpz6E/edit?gid=0#gid=0'); // Name of the backup folder var folderName = "Backup youtube videos"; // Get the root folder of the user's Google Drive var...
AppSScript Code Copy Code function onOpen() { var ui = SpreadsheetApp.getUi(); ui.createMenu('Chatgpt AI') .addItem('Generate Answers', 'generateAnswersForQuestions') .addToUi(); createHeader(); } function createHeader() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var headers = ; var headerRange = sheet.getRange('A1:B1'); headerRange.setValues(); // Apply bold...
AppSScript Code Copy Code function sendEmailOnEdit(e) { if (!e) return; // add this line to check if "e" is undefined var sheet = e.source.getActiveSheet(); var sheetName = sheet.getName(); var recipients = "sharma.mohit@outrightcrm.com"; var subject = "Someone Edited a Google...
AppSScript Code 1 Copy Code function doGet() { return HtmlService.createHtmlOutputFromFile('index'); } function processForm(form) { var sheet = SpreadsheetApp.getActiveSheet(); var row = ; sheet.appendRow(row); return true; } AppSScript Code 2 Copy Code <!DOCTYPE html> <html>...
AppSScript Code Copy Code function sendEmailOnEdit(e) { if (!e) return; var sheet = e.source.getActiveSheet(); var sheetName = sheet.getName(); var recipients = "sharma.mohit@outrightcrm.com"; var subject = "Someone Edited a Google Sheet"; var body = "The Google Sheet named '" +...
AppSScript Code Copy Code function fetchEmailData() { var labelName = "Fetch Gmail data"; // replace with the name of your label var batchSize = 500; // adjust the batch size as needed var sheet = SpreadsheetApp.getActiveSheet(); var data =...
AppSScript Code Copy Code function onOpen() { const ui = SpreadsheetApp.getUi(); const menu = ui.createMenu('AutoFill Docs'); menu.addItem('Create New Docs', 'createNewGoogleDocs') menu.addToUi(); } function createNewGoogleDocs() { // Define template and destination folder IDs const googleDocTemplateId = '1G-qP5xoZAdjp3d1LAW9zk5tbum4vBS-GP9B51MTbDW8'; // replace with...
AppSScript Code Copy Code function doGet(req) { var doc = SpreadsheetApp.getActiveSpreadsheet(); var sheet = doc.getSheetByName('sheet1'); var values = sheet.getDataRange().getValues(); var output = ; for (var i = 0; i < values.length; i++) { if (i == 0) { continue;...
AppSScript Code Copy Code function checkURLs() { var sheet = SpreadsheetApp.getActive().getSheetByName("Sheet1"); // Replace "Sheet1" with the name of your sheet var range = sheet.getDataRange(); var values = range.getValues(); for (var row = 0; row < values.length; row++) { var...
AppSScript Code Copy Code function shortenUrls() { var sheet = SpreadsheetApp.getActive().getSheetByName("Sheet1"); // Replace "Sheet1" with the name of your sheet var dataRange = sheet.getDataRange(); var data = dataRange.getValues(); var urlColumn = 1; // Replace "1" with the column number...
AppSScript Code Copy Code function scheduleDripEmails() { var sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"); var sheet2 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet2"); var dataRange = sheet1.getDataRange(); var data = dataRange.getValues(); var numRows = data.length; for (var i = 1; i < numRows; i++) { var recipientName...