AppsScriptPulse

Mergo: Designing a template gallery in a Google Workspace add-on

Mergo is a mail merge add-on for Gmail. With the new gallery, users can easily create, share & reuse templates.

Instead of starting your email from scratch, you can open the gallery and select a template: it will appear as a draft in Gmail.

We recently had Romain Vialard join us on Totally Unscripted to talk about some of his add-ons. This post is another example of Romain’s continual exploration of Apps Script, this time looking the new Grid view for the CardService. You an find out more in the source link.

Source: Mergo: Designing a template gallery in a Google Workspace add-on

Create a book tracker using Apps Script and the Google Books API in 10 minutes

I wanted a quick and easy way for my kids to track the books they read, as well as a way for my wife to catalog all the books in the house. I know there are other services out there like Goodreads that can store your book list…but I just wanted to house the data myself, and not have to create accounts for my young kids.

Nice little project that glues together Google Forms and Sheets and the Google Book API with a little but of Google Apps Script. Follow the link for more information and the source code.

Source: Create a book tracker using Apps Script and the Google Books API in 10 minutes

Create Google Classrooms using Google Apps Script

Creating a Google Classroom and maintaining it can be a bit hectic for so many students in a school. Say you are the moderator of your school and your task is to create 10 Google Classrooms for different teachers. Manually doing this can be a very hectic process, that’s where Google Apps Script comes in.

Using Google Apps Script, you can automatically create Google Classroom with the data in the Google Sheet, and paste the Class code in the Google Sheet.

Source: Create Google Classrooms using Google Apps Script

How to Make Your NPM Package Available in Google App Script

Boboss74, CC BY-SA 4.0, via Wikimedia Commons

I recently came across GAS — Google App Script and immediately the first hurdle I had to overcome to was make my NPM packages available on there. I had to hop through a couple loops to make this happen. I wanted to call out the steps in this blog so it’ll hopefully help someone out there as well.

In Pulse we’ve previously highlighted a couple of approaches for using NPM libraries in Google Apps Script. The linked source post come from, recent guest on Totally Unscripted, Nima Poulad, Senior Software Engineer at DocuSign. Nima highlights a quick and dirty approach of using eval() on hosted NPM libraries, but goes on to show how Browseify can be used to convert NPM libraries, highlighting some considerations for this approach.

Source: How to Make Your NPM Package Available in Google App Script

Multiple Sheets Action. Use Macro Recorder 🔴

Image credit: Max Makhrov

The idea: perform the same action on multiple sheets. The idea is not new, my approach was to use macro each time to see the correct code snippet. It was useful and saved me hours on my current project.

A clever solution from Max Makhrov with some boilerplate script that makes it easy to use a recorded macro across multiple sheets. To make this solution even better I’ve suggested an addition which activates the sheet which makes it easier to reference recorded macro functions. To see in action here is a copy of Max’s Google Sheet with updated code.

Source: Multiple Sheets Action. Use Macro Recorder 🔴

How to call Google Cloud Run (or Cloud Functions) from Google Apps Scripts

I struggled how to make an authenticated call from Apps Scripts to Cloud Run even though I had owner rights on the GCP project. This post describes how to do it without reinventing the wheel.

Some very useful setup tips for using Cloud Run with Google Apps Scripts including additional references if you are keen to explore more.

Source: How to call Google Cloud Run (or Cloud Functions) from Apps Scripts

Track Customer Subscriptions with Google Spreadsheet & App Script by sending an Email Automatically

Do you still spend time every day monitoring your sales report, identifying which customer subscription is going to expire soon, and manually draft an email to send out to your customer? Would it be better if this manual task can be automated every day for you? If that’s the case, this article can be a great help for you!

Following on from some recent Google Sheet payment solutions here’s a tutorial that highlights how you can use Sheets and Apps Script as a payment reminder tool. Combine with Stripe or Razorpay and you have a complete subscription management solution.

Source: Track Customer Subscriptions with Google Spreadsheet & App Script by sending an Email Automatically

Create personal stock portfolio tracker with Google Sheets and Google Data Studio

Image credit: All Stacks Developer

The idea is to take advantage of what Google Sheets and Google Data Studio offer and pull them together to build a personal stock portfolio tracker.

This post provides an insight into how you can maximise the combination of Google Sheets, Data Studio and Apps Script to create powerful dashboards. The source link provides an overview of the solution and if you are interested in finding out more about how this solution works visit LION stock portfolio tracker guide (from there you can make a copy of the demo and see the code).  

Source: Create personal stock portfolio tracker with Google Sheets and Google Data Studio

How to Use Service Accounts and OAuth2 in Google Apps Script

Image: Dmitry Kostyuk

Give your scripts privileges that your users don’t have … In 99% of all cases, authorizations in Google Apps Script are extremely straightforward. When a user executes their script, they run it as themselves with their respective authorization scopes. … However, what if you need to give more rights to your app beyond what your intended users will have? … This is where service accounts come in.

A useful post to find out more about service accounts and how to use them with Google Apps Script. The tutorial put together by Dmitry Kostyuk includes example code for using a service accounts with Firestore, BigQuery and the Admin Directory API.

Source: How to Use Service Accounts and OAuth2 in Google Apps Script

How I manage password encryption for my last Google Workspace add-on onleetransfer | by Stéphane Giron | Aug, 2021 | Medium

Manage password encryption in Firebase Cloud Functions for Apps Script using bcrypt with an example of front-end integration.

Useful post from Stéphane Giron with an overview of how Firebase Cloud Functions can be used in combination with Google Apps Script to provide add-on functionality.

Source: How I manage password encryption for my last Google Workspace add-on onleetransfer | by Stéphane Giron | Aug, 2021 | Medium