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
to force write updates to a Google Sheet. As this method relies on
it’s worth keeping in mind for bigger data sets that using HTMLService and a custom dialog or
Al from coda has provided this gist
Source: visually display status when looping through google sheets data
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
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
Usual post highlighting the
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
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
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 video conferencing (Google Meet or Zoom) all from a Google Sheet.
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
I use Google Apps Script to support staff and students in my job. I enjoy dabbling with creating tools to help with automation and I freely share my learning experiences on my blog: www.pbainbridge.co.uk
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
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’
In this tutorial, we will cover creating a custom Table of Contents that lists your Google Sheets tabs on its own tab using Google Apps Script. This Table of Contents (TOC) will update whenever you open your sheet or choose to update it with a button.
As always a very detailed explanation of how this solution works from Scott ‘Yagi’ Donald.
Source: Create a custom automated Table of Contents for your Google Sheets tabs with Google Apps Script – Yagisanatode
Don’t have time to get to all your library duties? Need more staff? Create them using code! I work in a school library and could definitely do with some help around here, so let’s write some programs to streamline a few library duties and add some “virtual staff”.
In this post, we’ll create a small tool to help get word out to the school community about book recommendations and new releases/purchases in the library. The plan is to make use of a Google Sheet to pre-populate a bunch of data as time goes on and then have a Google Apps Script pull that data periodically, display it on our digital displays using Google Slides as well as to send email updates to the community.
Nice example for creating Google Slides from Google Sheets for digital signage. The post has a useful explanation of what is going on in the code for those interested to learn more.
Source: Creating a book recommendation engine using Google Apps Script — Thoughts from a Technologist turned School Librarian
Provide your subscribers an option to opt-out of mailing lists by adding unsubscribe link using Google Apps Script.
A useful post on creating a system to allow users to indicate they wish to opt-out of further mailings (useful for PECR or similar electronic communications regulation compliance). The post has the broad steps and code needed for this solution and you will need to fill in some of the blanks like how to record the
in the Google Sheet.
Source: Add Unsubscribe link in emails using Google Apps Script
The new Twitter API brings a much better way to get a list of publicly available Tweets in Google Sheets to retrieve Tweets and their details, including the username of the author.
Always nice to see when other web services feature Google Apps Script. This is a great example from Daniele Bernardi (@i_am_daniele), DevRel at Twitter, highlighting how Google Sheets custom functions can be used to interact with the Twitter API. The post has everything you need to know plus a link to a gist with all the code.
Source: The Tweet formula for Google Sheets
Recently I raised a support ticket with a tech company I was subscribed to where we were trying to resolve an integration issue I had with their service. Once we had it all resolved they followed up with a feedback form. That feedback form just happened to be a Google Form.
In this tutorial, I’ll walk you through accessing the prefill tool in Google Forms. Then, if you are keen on doing some coding, we’ll create a little custom feedback form for unique users that we will deliver via email.
Nice tutorial from Scott ‘Yagi’ Donald on using prefilled Google Form links. For beginners the post includes everything you need to know. For more experienced developers Scott includes some nice code for handling Google Sheet data.
Source: Create custom prefilled Google Forms links in custom emails with Google Apps Script – Yagisanatode
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
“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