AppsScriptPulse

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

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

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)

Create a room availability dashboard for Google Workspace with onleetable and Apps Script

Make a Room availability dasboard for your Google Workspace domain wihtin a minute with onleetable and Google Apps Script

This post from Stéphane Giron caught my eye for a couple of reasons. Besides a quick and easy solution for displaying room availability in an attractive table as a bonus you can see/copy the script Stéphane uses to extract calendar data into a Google Sheet. Follow the source link for the code and more details.

Source: Create a room availability dashboard for Google Workspace with onleetable and Apps Script

BAS#005 | Create a Google Slides presentation handout in Google Docs with Apps Script

Generate summary documents of your Google Presentations with thumbnails and speaker notes using Apps Script. In this BAS you will learn how to generate a summary text document with the thumbnails and notes obtained from the slides from a Google presentation. For this we will use the Apps Script services of Documents (mainly) and Presentations. Plus, you’ll do it efficiently thanks to the awesome UrlFetchApp.fetchAll() method.

If you don’t speak/read Spanish you’ll have to hit Google Translate to read this latest contribution from Pablo Felip. As described by Pablo: “Apps Script Basics (Básicos Apps Script – BAS, in Spanish) is a series of posts targeted to newcomers to Google Apps Script. Each BAS solves a simple, real-world problem, provides a thorough step-by-step break-down of the source code suitable for people who are learning how to leverage this platform and introduces key Apps Script patterns.”. This particular ‘Básicos Apps Script’ includes some useful information on building tables in Google Docs which could be useful in other contexts like generating reports.

Source: BAS#005 | Generating a presentation summary document with Apps Script

Starter guide for creating a Google Drive Card Service Add-on with Google Apps Script

Let’s extend Google Drive with Apps Script to create a simple add-on, use CardService for the UI, where we’ll select a few spreadsheets and pass them to the next card with navigation.

For those unfamiliar add-ons for Google Workspace come in a couple of flavours. The Google Editor Add-ons have been around the longest created with Google Apps Script and it’s HTML Service.  Google Workspace Add-ons can also be created for the Google Editors (Docs, Sheets, Slides, Forms) as well as Gmail, Calendar and Drive using the Card Service with either Google Apps Script or another runtime environment. This post from Nibesh Khadka provides a great overview of how to create a Google Drive Add-on using Google Apps Script and the Card Service. It covers the basic setup with lots of references to relevant parts of the official developer documentation.

Source: Managing Google Drive with Google Apps Script

Autofill Google Sheet Formula with Google Apps Script

Use Google Apps Script to Autofill a formula down rows in a Google Sheet.

Autofill Google Sheet Formula

Autofill Google Sheet Formula

The following Google Apps Script is designed to insert a formula into the first row of data in a Google Sheet, then use Autofill to add the formula to the subsequent rows below. In this example I am just using a simple Sum formula to add up age and shoesize for demo purposes. The need to do this came about when combining multiple Google Sheet files however, that needed calculations adding to the final composed version.

Source: The Gift of Script: Autofill Google Sheet Formula

Clearing cells in multiple Google Sheets using Google Apps Script

This is a sample script for clearing the discrete cell values on multiple sheets using Google Apps Script.

Handy little code pattern for clearing ranges across multiple tabs in Google Sheets. Snippets are provided for both SpreadsheetApp and the advanced Sheets service.

Source: Clearing Discrete Cell Values on Multiple Sheets using Google Apps Script

Move column positions in Google Sheets with Google Apps Script

Move columns in a Google Sheet

Move columns in a Google Sheet

The following Google Apps Script is designed to reposition 2 columns within a Google Sheet. It is a small and simple bit of code but it was something new to me when I was collating lots of files together and appending columns at the end – which then needed to be moved.

In this example I am moving columns ‘collegename’ (E) and ‘shoesize’ (F) to the left of ‘postcode’ (D). So that ‘postcode’ will be the final column (F).

Source: The Gift of Script: Move Column Positions

Quickly format multiple Google Sheets with Apps Script

In this post, we’re going to see how we can very quickly format multiple Google Sheets with a little help from Apps Script.

The idea of this post, came from the Department of Education in Hawaii, where they have over 300 schools and a guy who works there told me he had to format over 300 Google Sheets the same way, and wondered how this could be done with Apps Script.

Easy I said! And I thought it was a typical example of how a little knowledge of Apps Script can help you speed up your work and allow you to spend less time doing boring, repetitive work, and focus more on the data itself.

Let’s see how it’s done!

This is a nice real world example of how Google Apps Script can be used to make a manual routine task more efficient. The post by Baz Roberts includes a detailed explanation of what is going on in the code making it also a great learning resource. If you have some more complicated Google Sheets formatting in mind you might want to also look at Google Sheets Macros, which lets you record every action you take within the spreadsheet creating a script you could call similar to the format functions included in the post.

Source: Quickly format multiple Google Sheets with Apps Script (also available on bazroberts.com)