AppsScriptPulse

Google Apps Script Example: Automated YouTube Stats Workflow

Extract a list of Google Group members into a Sheet with Google Apps Script

Google Groups

Image: Google

Extract a list of members of a Google Group (email address and role) into a Google Sheet. You simply enter the email address of the Google Group that you belong to and then run the Function.

Source: The Gift of Script: Extract a list of Google Group members into a Sheet

Visually display status when looping through Google Sheets data with Google Apps Script

show a processing status in a cell when looping through rows in google sheets using google apps script.

When working with small batches of data it can be useful to show the user that the data is being processed. Here is an example script from Sourabh Choraria which use SpreadsheetApp.flush() to force write updates to a Google Sheet. As this method relies on .setValue() instead of .setValues() it’s worth keeping in mind for bigger data sets that using HTMLService and a custom dialog or Speadsheet.toast()

If the .setValue()/.flush() Al from coda has provided this gist

Source: visually display status when looping through google sheets data

How to Unsubscribe from Mailing Lists and Junk Newsletters in Gmail with Google Apps Script – Digital Inspiration

Christian Heilmann’s tweet – Feature request for Gmail: automatically find and follow the unsubscribe link in all highlighted emails – prompted me to build an automated system for unsubscribing your Gmail address from the bulk senders. Here’s how it looks…

This is an older example from Amit Labnol that recently pinged my Google Alerts from this Best Unroll.me Alternatives post. The source post from Amit has some nice details about how marketing emails are marked up and the code shared might be a nice starter for your own solution.

Source: How to Unsubscribe from Mailing Lists and Junk Newsletters in Gmail – Digital Inspiration

Replace text in Google Spreadsheets with Apps Script using TextFinder

Google Sheets has a powerful find and replace function. But you may want to use Google Apps Script to do the same job. StackOverflow has a question on this. The accepted answer would require you to loop through all cells, find the text, replace it and post the new text back to the cell. Google Apps Script has a more powerful, and simpler, method called TextFinder.

Usual post highlighting the TextFinder method which you can use to find and replace text in Google Sheets. The post has more information about this method and how to use it.

Source: Replace text in Google Spreadsheets with Apps Script

Using Design Patterns in Google Apps Script – Introduction to façade and proxy patterns

A lot of users try and quickly learn GAS and use it to make their lives easier. It’s all great, however the code we sometimes tend to come across on StackOverflow and other sites lacks best practices, hence I thought it was time to start bringing them up and I will start today with design patterns.

As noted by the post author Dmitry Kostyuk the Google Apps Script V8 runtime opens up many new coding opportunities previously not available to Apps Script developers. Using the common use case, fetching data and writing it to a Google Sheet, Dmitry explains how the façade and proxy code patterns can be used to write efficient easy-to-read code.

Source: Using Design Patterns in Google Apps Script

Control Your Nest Thermostat And Build A Temperature Logger In Google Sheets Using Apps Script

Image: Ben Collins

Image: Ben Collins

If you have a Nest thermostat at home, you can access it from your Google Sheet by using Apps Script to connect to the Smart Device Management API. It means you can do some cool stuff like build a virtual, working Nest thermostat in your Google Sheet

Source: Control Your Nest Thermostat And Build A Temperature Logger In Google Sheets Using Apps Script

Bulk create Google Calendar events with optional Meet or Zoom

Bulk create Google Calendar events with optional video conferencing (Google Meet or Zoom) all from a Google Sheet.

Google Sheet columns allow for event details to be added

Google Sheet columns allow for event details to be added

Features of the tool

  • Performs an initial check that you have access to the provided Calendar to create events on.
  • Allows for events to be created on another Calendar that you have suitable access to (not just your own).
  • Uses toast popups to inform you of the progress as each creates each event per row.
  • Fast and efficient for creating a large number of events in one go.
  • Will not duplicate events if re-run, so you can continue to append further if you wish.
  • Provides a direct link to the created event from within the Google Sheet for easy access.
  • Performs a check of any missing ‘required’ information and informs the user via a popup so they can resolve this.
  • Includes ‘Log’ sheet to help output any error messages.
  • Has a ‘Reset’ option in the menu bar to remove all entered data and start from scratch.
  • Replicates 90%+ of the settings you can adjust when directly creating an event in Google Calendar.

Source: The Gift of Script: Bulk create Google Calendar events with optional Meet or Zoom – overview

Website Status/Monitor Check with Google Apps Script 

Is your website currently up and running? Wouldn’t it be nice to get notified if your website was down? Using Google Apps Script and Google Sheets, let’s create something that will check a list of your websites daily and email you if any of them appear to be down.

Nice little website status/monitor solution. The post full documents the code so if you are just learning Apps Script a nice resource.

Source: Website Status Check

Adding an unsubscribe link to the Google Workspace Solution Gallery ‘Mail merge using Gmail and Google Sheets’

Recently I came across a nice post from Ravgeet Dhillon, which looked at how to Add Unsubscribe link in emails using Google Apps Script. The solution uses a Google Sheet and a Google Apps Script web app to add an unsubscribe link to emails. As I noted when shared via AppsScriptPulse this is a useful addition if your mailing needs comply with PECR or similar electronic communications regulation compliance.

Having recently updated my ‘Create a mail merge using Gmail and Google Sheets’ in the Google Workspace Solution Gallery to handle inline images I thought it would be useful to show how this example can be extended to include a variation on Ravgeet’s post.

Source: Adding an unsubscribe link to the Google Workspace Solution Gallery ‘Mail merge using Gmail and Google Sheets’