Apps Script createEventFromDescription

createEventFromDescription Apps Script from a description. Here’s a code snippet that demonstrates how to achieve that: function createEventFromDescription() { var calendarId = ‘YOUR_CALENDAR_ID’; // Replace with your calendar ID var description = ‘Event Description’; // Replace with the description for your event var calendar = CalendarApp.getCalendarById(calendarId); var event = calendar.createEventFromDescription(description); Logger.log(‘Event created: ‘ + event.getTitle()); … Read more

Count the number of occurrences of a given substring in a string

Count the number of occurrences of a given substring in a string function COUNT_SUBSTR(str,sbStr){  let count = 0;  let pos = str.indexOf(sbStr);  while (pos !== -1){    count++;    pos = str.indexOf(sbStr,pos+1);  }  return count; } The provided code defines a function called COUNT_SUBSTR that takes two parameters: str and sbStr. The purpose of this function is … Read more

10 Google Sheets formulas and Videos with Example Code

Google Sheet Formulas Formula to calculate the average of the values in a given rangeConcatenate two strings and capitalize the first letterCalculate the factorial of a given numberCount the number of occurrences of a given value in a rangeCalculate the distance between two sets of latitude and longitude coordinatesCheck if a given string is a … Read more

Google Apps Script Video Lessons Source Code

Add Columns with Apps Script Sort By Column Index value Filter the rows in a Google Sheet Create a pivot table in a Google Sheets Create a new Google Slides presentation Add Columns with Apps Script function addColumn() {   const ss = SpreadsheetApp.getActiveSpreadsheet();   const sheet = ss.getSheets()[0];   const sheetName = sheet.getName();   sheet.insertColumnBefore(1);   const lastCol = … Read more

How to select a sheet and set it active with google apps script

To select and activate a sheet in Google Sheets using Google Apps Script, you can use the setActiveSheet() method of the SpreadsheetApp class. Here’s an example code snippet that selects the sheet named “Sheet1” and sets it as the active sheet: function selectAndActivateSheet() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName(“Sheet1”); ss.setActiveSheet(sheet); } In … Read more

IWD 2023 – Dare To Be Ottawa Laurence Svekis Power Up with Google Apps Script

Power Up with Google Apps Script Celebrate International Women’s Day with a full-day event featuring a Google speaker and Google Developer Experts on topics such as leadership, web technologies, Google Cloud Platform, Firebase, data analytics, machine learning, augmented reality and more. About this event Join us on April 23 from 11 am-2pm for an exciting … Read more

Setting Triggers in Apps Script to Automate tasks

Sure, here’s an example of how to set up a time-driven trigger in Google Apps Script to automate a function: Create triggers with code or manually in the interface function myFunction() {// Your code here} function createTrigger() {ScriptApp.newTrigger(‘myFunction’).timeBased().everyMinutes(30) // Set the frequency here.create();}This code defines a function called myFunction() that contains the code you want … Read more

Simple Google Apps Script Sheet Addon Code snippet

Google Apps Script add-ons are a type of script that extends the functionality of Google Docs, Sheets, and Forms. They are created using Google Apps Script and can be published and shared with other users. Here’s an example of a Google Apps Script add-on code: function onOpen() {var ui = SpreadsheetApp.getUi();var menu = ui.createMenu(‘My Custom … Read more