AppsScriptPulse

Beginner’s guide to exponential backoff in Google Apps Script for handling rate limit errors

Exponential Backoff, a process by which when something fails you try again a set number of times whilst increasing the delay between each attempt.

Sample Apps Script code for Exponential Backoff

Sample Apps Script code for Exponential Backoff

The following Google Apps Script is designed to explore Exponential Backoff – a process by which when something fails you try again a set number of times whilst increasing the delay between each attempt, up to a certain point.

I needed this for a tool I built which adds Guests to a Calendar event from a Google Form submission. Whilst I was using ScriptLock to prevent simultaneous submissions, the code ran so fast that it would infrequently trip the Calendar API with the following error message “API call to calendar.events.patch failed with error: Rate Limit Exceeded”.

By infrequently I mean a reported issue only once in 3,500 submissions over the course of 12 months. Enough however to take the opportunity to learn about Exponential Backoff and to squash that single instance.

Just a note that this is one way to implement it.

Source: The Gift of Script: Exponential Backoff

Check comma separated email address is valid

Loop through a Google Sheet cell of comma-space separated email addresses and check their format is valid, otherwise display a user popup.

The following Google Apps Script is designed to loop through a Google Sheet cell of email addresses that have been separated by a comma and space. It then uses a regular expression (regex) to confirm the email address meets the correct formatting criteria.

This code was developed as a way of implementing additional checks when asking users to be precise in how exactly they enter multiple email addresses. So if they were to forget the space for instance it could alert them, before the rest of the code risked failing as whatever task it was designed to do.

Source: The Gift of Script: Check comma separated email address is valid

[Live] Tips and tricks to getting the most out of Google Workspace with Apps Script – October 06, 2023 @ 9am PT / 4pm UTC

Join the experts on October 6th to learn Apps Script tips and tricks to combine APIs, automation, configuration as code, and more to improve your productivity using Google Workspace. Whether you’re a seasoned developer or just getting started with low-code development, this event will provide you with the insights and information you need to start building custom solutions with Google Apps Script.

Recently on Pulse we highlighted the ‘Getting the most out of Google Workspace with Apps Script, tips and tricks’ session as part of Google Cloud Next ’23. This wasn’t one of the livestreamed sessions, but the good news is the session is being rerun online on October 06, 2023 @ 9am PT / 4pm UTC, hosted by Charles Maxson and Kara Ireland from the Google Workspace team.

As well as using the source link to register for the event there is a form link where you can submit your questions in advance. If you can’t make the live session registering will also mean you’ll get notified about the recording. Looking forward to seeing other community members in the YouTube Live chat!

Source: Tips and tricks to getting the most out of Google Workspace with Apps Script

How to publish to the Google Workspace Marketplace [Video Tutorial]

In this video you will find out how you can publish your app to the Google Workspace Marketplace.

Publishing a Google Workspace Add-on or Chat App can be a bit daunting. We’ve feature a couple of ‘how-to’ guides, which go into the detailed steps of the process, and my favourite has to be Alice Keeler’s top tips for getting your Google Workspace Add-on published. If you are still unsure about the Google Workspace Marketplace publication options and information required this video from Chanel Greco gives an overview of the entire process from start to finish.

Source: How to publish to the Google Workspace Marketplace

Live and pre-recorded tech talks for Google Workspace Admins

Google Workspace Admins is an IT admin driven series of live and pre-recorded technical talks covering any and all topics that a Google Workspace Admin would find useful. We’ll cover topics that would benefit the Tier 1 IT help desk admin on up to the super admin and the CIO. Signup to get invited to all future events.

I’ve been a Google Workspace Admin for over a decade, mostly working on small domains. More recently my role requires me to support larger domains, often with enhanced security needs and the requirement to generally do everything on a bigger scale. This is where tools like GAM and Google Apps Script become essential to help with the heavy lifting.

Broadening the range of Google Workspace domains I support has also required me to broaden the channels and communities where I can learn and keep up-to-date. Recently, I was pointed to the Google Workspace Admins YouTube channel. Whilst this channel is relatively new it’s bursting with a wide range of technical focused solutions and discussions. Follow the link to subscribe to the channel and there is a form to get invited to all future events.

Source: Google Workspace Admins

Google launches a YouTube channel dedicated to Google Workspace development

Welcome to the Google Workspace Developers YouTube Channel, where developers of all types can learn about building solutions with Google Workspace. Explore the full range of the Google Workspace Platform from Apps Script to Chat Apps to Workspace APIs and more. Leverage Google Workspace’s products such as Gmail, Docs, Sheets, Slides, Drive, and many more to customize, integrate, or extend these products with our developer tools. Visit our website → developers.google.com/workspace

Google has just launched a new YouTube channel dedicated to Google Workspace developers. Google Apps Script community members might recognise the first featured video series on the ‘Anatomy of Google Chat apps’, which is presented by Chanel Greco who recently joined the Google Workspace Developer Relations team. As well as featuring a curated collection of previous Google content on topics from no to low code solutions the channel also includes content from the wider community.

Source: Google Workspace Developers

GWAOw! 4 – Forms History a Google Forms Add-on by Martin Hawksey

Forms History is a Google Workspace Add-on that allows you to monitor your version history and store copies in Google Forms

Not just talking the talk, but also walking the walk. Shortly before taking a new role at CTS, the largest dedicated Google Cloud Partner in Europe, I published Forms History an add-on to enable revision history functionality in Google Forms.

Fellow Google Developers Expert, Scott Donald, has picked this up in the latest episode of GWAOw! his dedicated to Google Workspace Add-on review show. You can follow the source link for the YouTube clip and more. As part of the episode Scott rightly highlights the creative work of Alice Keeler, which hasn’t just included artwork but Alice has also provided a huge amount of support in promo and usability.

If you are interested in the inner workings of Forms History there is a related post on Working with the Google Drive API Revisions history: Tips for handling revision merges with Google Apps Script.

Source: GWAOw! 4 – Forms History by Martin Hawksey – Yagisanatode

GWAOw! 3 – Crop Sheet by Eric Koleda (how to keep Google Workspace Add-on development simple with custom menus)

Crop Google Sheet Data to the data range or a selection in 2 button click with Crop Sheet. Full Walkthrough

Does this Google Workspace Add-on developer story sound familiar? You are able quickly write the code that executes your add-on functionality, but then you spend days buried in HTML or Card Service making the UI. The Crop Sheet add-on by Eric Koleda highlighted in this latest GWAOw! episode is a great example of what is possible just by using custom menus. For what it is worth the source code (all 73 lines including comments!!!) is on GitHub. Follow the source link for the video demo from Scott Donald and links including the GitHub repo.

Source: GWAOw! 3 – Crop Sheet by Eric Koleda – Yagisanatode

How to access an API with Google Apps Script and API calls and Google Sheets manipulation

In this video you will learn how to access an API with Google Apps Script.

Chanel Greco has created this video tutorial which walks through some different ways you can interact with other sites with Google Apps Script to get data into Google Sheets. For the tutorial Chanel uses the Weather API and by coincidence Luxman Ravindrakumar has also shared a similar tutorial on Medium explaining how to use the OpenWeather API. So if you prefer learning by watching or reading you’ve no excuses :). Check the sources links below for both tutorials.

Sources: How to access an API with Google Apps Script (YouTube) and API Calls & Spreadsheet Manipulation With Google Apps Script

Google Workspace Add-On Walkthroughs (GWAOw!) 2 – ImportFromWeb by NoDataNoBusiness – Yagisanatode

In this episode of Google Workspace Add On Walkthroughs (GWAOw!), we take a look at ImportFromWeb by NoDataNoBusiness.

ImportFromWeb is a powerful web scraping tool for Google Sheets that allows you to grab data from any website. The creators call it IMPORTXML on steroids.

The latest episode from Scott Donald’s GWAOw! is now available. As explained by Scott ImportFromWeb is a Google Sheets add-on which allows users to use the custom function to import data from other websites into Google Sheets.

Even though this add-on is primarily used to add a custom function to Google Sheets the developers, NoDataNoBusiness, have taken the time to use the sidebar with some useful UI elements to help users get started.

Source: GWAOw! 2 – ImportFromWeb by NoDataNoBusiness – Yagisanatode