AppsScriptPulse

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

Create membership expiration in Google Groups for Google Workspace

Manage Google Groups membership expiration with Google Apps Script and Cloud Identity API

As noted by Stéphane Giron Google Group member expiration is not available on all types of Google Workspace accounts, but this post is a useful reminder of what is now possible when it is. The most includes a full explanation and code to get started.

Source: Create membership expiration in Google Groups for Google Workspace

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

Save PDF from URL directly to Google Drive using Google Apps Script

There is a PDF file on the Internet. Say this one. And you want to save it to your Google Drive. The tedious way is to download it to your computer. … and then upload it to your Google Drive. (Seems like too much work.) If only you could send the PDF straight from where it is stored on the Internet, to your Google Drive…

Nice little snippet which shows how you can add .pdf files to Google Drive.

Source: Save PDF from URL directly to Google Drive using Google Apps Script

Modern Angular in Google Workspace Editor Add-ons

I intend this post for established Add-on developers who want to use Angular in Google Workspace editor Add-ons and Google Apps Script webapps. This does not attempt to show how to create Add-ons or Angular apps, but the tooling and build process to use Angular apps in Add-ons. I am also assuming familiarity with installing and using CLI tools in your development workflow.

We recently had the author of this post, Spencer Easton, on an episode of Totally Unscripted to talk about this topic. This companion post provides an overview of using Angular for Add-on development. There is a cost associated with this solution has separate hosting is required for the Webpacks, but as covered by Spencer the cost is low (for a 100K+ users add-on the cost is $8/month).

Source: Modern Angular in Google Workspace Editor Add-ons

Maintain Google Apps Script in an Enterprise environment – Google Apps Script deployment with Cloud Build

In this article I will showcase the way I deploy Google Apps Script code in an Enterprise environment. I will share the actual build file and the necessary steps and tools to reproduce my workflow. This approach does require Google Cloud Platform knowledge and a credit card. The instructions are high level, this article is not a codelab.

For those interested in scaling up their Google Apps Script development Jasper Duizendstra outlines how you can use Google Cloud Build for version control and Continuous Deployment (CD). As Jasper notes:

When the CD pipeline is in place it becomes easy to deploy the script, separate the responsibilities and support multiple versions and implementations of the code …  the most important advantage of using CD is the mindset that it enables. It provides an environment where I feel confident and safe to create small incremental changes in my applications.

Source: Google Apps Script deployment with Cloud Build

Tracking Email Opens with Gmail, Sheets, and Apps Script

This walkthrough will let you build a tracker for email opens using Gmail, Google Sheet, and Google Apps Script.

Interesting solution that popped up in the Google Apps Script community for logging email opens using Google Apps Script. The post includes a detailed walkthrough for setting this up as well as some caveats about reliability.

Source: Tracking Email Opens with Gmail, Sheets, and Apps Script

Introducing LASTEDIT(), a Timestamp Formula for Google Sheets

“When was the last time this sheet was uploaded?” Probably one of the biggest requests I get is how do I add a timestamp to check when some particular range was changed. Well, [here] is a simple function you can add to your Google Sheets doc to add the formula LASTEDIT()

The question of recording when a cell/range has been edited has landed in my inbox before. I’ve not tested this solution myself but from the scan of the script worth noting that this solution will only work on one cell array per Google Sheet, so some modification might be required if you have more than one range you’d like to monitor.

Source: Introducing LASTEDIT(), a Timestamp Formula for Google Sheets

Google Apps Scripts Libraries — How to set them up and turn Slack into a real-time logging platform

This post shows how to setup Libraries in Google Apps Scripts to share code and functions. We will use this while using Slack for logging.

Nice post from Matt “Rudy” Benton on using libraries in your Apps Script projects to make it easier to share code/credentials. Matt illustrates this with a Slack app that has also been documented.

Source: Google Apps Scripts Libraries — How to set them up and turn Slack into a real-time logging platform

5 Great Features in the new Google Apps Script Editor for Beginners

The new editor (Integrated Development Environment — IDE) for Google Apps Script is out! There is a lot of features in the new editor to make your lives easier; here’s my top 5 favorites that I think are helpful for beginners to write and manage their scripts.

We’ve reshared a number of community contributions about the new Apps Script IDE, but this is the first we’ve seen that is specifically targeted at beginners. As well as useful functionality within the IDE Cleo also shares some of her tips which should help writing code easier.

Source: 5 Great Features in the new Google Apps Script Editor for Beginners