AppsScriptPulse

An automatic random team maker using Google Apps Script

In this post, we’re going to look at a script to be able to make even teams from a selection of players. I play football every Sunday and every week my friends sign up to play and most weeks there are different players playing, so we end up having to make the teams, and trying to do it as fairly as we can, which inevitably takes some time.

Nice ‘weekend project’ from Baz Roberts highlighting how Google Apps Script can be used to do a weighted random shuffle of data. The post includes a line-by-line explanation of what the script is doing and a great resource if you are at the beginning of your Apps Script journey.

Source: Automatic Team Maker — Apps Script (also available on bazroberts.com)

Efficient file management using batch requests with Google Apps Script 

Google Drive alone can handle small file management jobs, but for larger batches of files, it can be too much for a simple Drive script to manage. With Google Apps Script, even large batches can be executed within 6 minutes, offering businesses the monetary and time benefits of efficient file management. This report looks at how Google Apps Script improves file management with batch requests, judging its efficacy by measuring the benchmark.

We’ve regularly highlighted work from Kanshi Tanaike in Pulse and it’s nice to see it also being highlighted in the official Google Cloud Blog. I’m sure many Google Workspace developers, like me, have encountered issues with managing large volumes of Google Drive files. In the post Kanshi Tanaike highlights how batch methods can be used to greatly speed up the process when interacting with the Google Drive API.

Source: Efficient File Management using Batch Requests with Google Apps Script | Google Cloud Blog

Google Chat Apps for Google Apps Script Developers

In this article, we will look at Google Chat Apps and go over some of the basics of developing a chat app with Google Apps Script.

Scott Donald provides a comprehensive overview of everything you need to know to get started with Google Chat app development with Google Apps Script.

One of the nice things about Google Chat app development is there are a number of different implementation architectures you can use, including Google Apps Script. Regardless of the architecture you choose there are some common steps such as GCP setup, receiving/responding to messages and using dialogues and card interfaces all covered in Scott’s post. Click through to find out more…

Source: Google Chat Apps for Google Apps Script Developers – Yagisanatode

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

How to send personalized text messages from Google Sheets (and make user friendly add-ons)

The Document Studio add-on helps you automatically send text messages when a new Google Form is submitted or when new rows are added to Google Sheets. You can thus build workflows that send text reminders when the invoices are due. Or you can get notified instantly when people fill out your Google Forms.

There was some speculation this week about how much revenue Amit Agarwal (Digital Inspiration) makes through his suite of Google Workspace Add-ons. I can neither confirm or deny the reported figures, but what I’m certain of is Amit is not only an expert developer but also clearly very talented at spotting opportunities and creating very slick user experiences.

This latest post from Amit is a case in point. No code, but plenty of screenshots demonstrating how users of his Document Studio add-on can integrate a SMS text service into Google Forms/Sheets. As this is achieved with a Webhook integration users aren’t limited to SMS services. Click through to the source link to see more screenshots similar to the one below:

Source: How to Send Personalized Text Messages from Google Sheets – Digital Inspiration

Creating a custom workflows using Google Forms and Google Sheets for provisioning virtual machines (VM) in Google Cloud

Is it possible to integrate Google Workspace tools such as Calendar, Sheets, and Forms with Workflows? For example, can you trigger a workflow from a Google Form or a Sheet? Turns out, this is not only possible but also easier than you might think. Let me show you how with a sample use case.

One of the great things about Google Workspace is there is never ‘one’ solution, there is enough flexibility for you to implement one of many workflows. A case in point is this post highlighting a Google Forms/Sheets powered approval system for allocating virtual machines (VM) to your users. As part of this the workflow includes calling the Compute Engine API to create the VM in Google Cloud.

Source: Triggering Workflows from Google Sheets

AppSheet/PayPal integrated payment solutions and tips on handling data in Google Sheets

In this post I’ll provide an overview of how PayPal was integrated into AppSheet with the help of Google Apps Script. Even if you are not interested in payment integrations this post also hopefully pulls together useful tips, best practices and code patterns for reading/writing data to Google Sheets.

Hopefully this post illustrates not only just a method for integrating a PayPal payment processor into an AppSheet app, but also a method which can generally be used to extend AppSheet functionality with Google Apps Script powered Web Apps.

As a bonus you also get some of my top tips for interacting with data in Google Sheets including efficiently reading/writing data for multiple users without concurrent overwrites.

Source: AppSheet/PayPal integrated payment solutions and tips on handling data in Google Sheets

Search Google Drive for ‘Shared with me’ with Google Apps Script

Search Google Drive for all of the files found in the Shared with me space and collate the results into a Google Sheet.

Search Google Drive 'Shared with me' and collate the results

Search Google Drive ‘Shared with me’ and collate the results

It will collate the following information into a Google Sheet:

  • The file name as a direct clickable link,
  • The file ID,
  • The type of file eg PDF, Google Sheet/Doc,
  • The file creation date,
  • The file last updated date,
  • The folder path,
  • The file owner.

Source: The Gift of Script: Search Google Drive for Shared with me

📮`MMailApp` for Google Apps Script: GmailApp+MailApp+Gmail API

The library lets you send emails, using MailApp, GmailApp, and Gmail API. The library takes care of parameters, so you do not need to care about which method to use. I had trouble with my project when I wanted to automatically send emails and suddenly for me we’ve reached the daily limit. This is why I’ve decided to make some research and be sure fewer bad things happen in the future.

If you are looking for a deep dive into Google Apps Script powered email sending options you are at the door of enlightenment. In this post from Max Makrov you not only to get an explanation of the options and benefits for sending email with MailApp, GmailApp and the Gmail API, but also a handy library, MmailApp. which makes it easy to switch between all three.

Source: 📮`MMailApp` for Google Apps Script: GmailApp+MailApp+Gmail API

Update Notion Databases from a Google Sheet (with Apps Script)

Phew — after two days of trying to find a solution for how to accomplish a popular, reasonable set of tasks in Notion’s API, I wanted to do my duties as a Google Developer Expert and blog the solution for others to use.

A familiar story for many developers is getting stuck on a problem. Max Brawer takes some time out to share how he solved a recent problem interacting with the Notion API with Google Apps Script. Max’s post includes lots of great tips for unpicking the steps required to get Apps Script talking to Notion.

Source: Update Notion Databases from a Google Sheet (with Apps Script)