AppsScriptPulse

Getting started with Google Apps Script – Aryan Irani

Image credit: Aryan Irani

In this course, we will be covering the basics of Google Apps Script and working our way by working with Google Sheets, Google Workspace API’s and more. After working with variables, operators, loops in Google Apps Script, we will be working with Google Sheets, where we will start out by getting and setting values in Google Sheets, followed by doing some amazing projects in Google Sheets and Google Apps Script. After working with Google Sheets, we will work with Google Forms, Google Classroom, YouTube and more.

It’s always pleasing to see new Google Apps Script courses being published. The latest one we’ve spotted has been created by Aryan Irani and hosted on Udemy. We’ve not taken this course but the landing page contains an overview and previews of some of the video content.

Source: Getting started with Google Apps Script – Aryan Irani

2-Way sync between sheets without a unique ID

How to setup 2-way sync within the same workbook without any unique ID.

I’m in the habit of adding IDs to sheets where I need to do lookups, but sometimes, I inherit a sheet without IDs in place (or I can’t edit the sheet structure). Spencer outlines a clever way to handle syncing between two sheets without using IDs in this video.

Source: 2-Way Sync: No Unique ID

Adding Members to a mailing list using an API, Google Forms and Google Apps Script

Image credit: Baba Funke

I decided to explore something similar to a Webhook for Google Forms. In other words, something that triggers another action when a Google form is submitted. In this case, when a Google form is filled and submitted, the results should be sent to an API endpoint for adding members to a database. I found an answer in Google Apps Script, a coding language based on Javascript which allows for programmatically extending Google Apps like Google Forms, Sheets, Docs etc.

A nice explanation of how triggers can be used in Google Forms to push new data to other systems. The post is easy to read and includes lots of screenshots to help prevent you getting lost.

Source: Adding Members to a mailing list using an API, Google Forms and Google Apps Script

How to Fetch Employee Data from Workday by Building the Great Deku Tree Inside of Google Sheets

They say you only live once, and, with that, you may only once find yourself at a company with a video-game-centric culture. Life at Twitch creates a unique opportunity to bring the magic of gaming to your workday, even when you’re in esoteric corners of the work world such as People Analytics.

Ever wondered how people reporting was handled at Twitch? Max Brawer, Head of People Analytics at Twitch, brings his ‘A’ game outlining how a little Google Apps Script and some Workday API wrangling can be used for some fun reporting. You can read more in the source link and here’s Max’s old post on The Endless Possibilities of Freeing Your Data from Workday and Putting it into Google Sheets: a How-to.

Source: How to Fetch Employee Data from Workday by Building the Great Deku Tree Inside of Google Sheets

The Gift of Script: Convert Google Doc to PDF in a given folder

Convert a Google Doc into a PDF in a given folder and optionally delete the original Doc file.

The following Google Apps Script is designed to create a PDF file of a Google Doc in a Drive folder that you specify, with the option to delete the original Doc. This snippet of code is from larger developed solutions and allows you to understand and replicate the process.

This post is somewhat of an updated version of this Convert Doc to PDF and move into a new folder blog post. Whilst the code in it still works it was part of my early days of learning Apps Script and it was also when Google allowed for files to exist in more than one place (a feature now replaced by Shortcuts).

Source: The Gift of Script: Convert Google Doc to PDF in a given folder

Letting users run a Google Apps Script on Google Sheets without authorizing scopes and showing the source code

This is a sample workaround for letting users running Google Apps Script on Google Spreadsheet without both authorizing the scopes and showing the script.

The post highlights the use of the existing =IMPORTML() Google Sheets function and a publish webapp to run a Google Apps Script without the end user having to authorize the script. A limitation of this approach, and also important warning to keep in mind, is the deployed web app needs to be deployed to run as the script owner and by anyone who has the web app link.

Source: Letting Users Running Google Apps Script on Google Spreadsheet without both Authorizing Scopes and Showing Script

Keep a Journal of Special Moments using Twilio Programmable SMS and Google Sheets

Learn how to build a Google Sheet journal that accepts new entries via text message. My toddler recently turned two and a half and my second daughter was born three weeks ago, so special moments are abundant but the ability to remember them is severely compromised. His suggestion of recording a memory every day in an Excel sheet or leather bound journal resonated with me, but after a few days of trying to find time to open up Excel and write a memory I realized I needed a more lightweight solution. … Twilio makes it easy and cheap to set up a dedicated phone number that can record those text messages to a Google sheet.

Nice example on the Twilio blog on using their service with Google Sheets. There is little setup required but this can all be achieved in 4 lines of code. Unfortunately, sending/receiving SMS messages with Twilio is not free, but it might be a service you keep in mind for Apps Script projects.

Source: Keep a Journal of Special Moments using Twilio Programmable SMS and Google Sheets

Bulk create Google Drive Folders and add Files 2.0

Bulk create Google Drive folders with optional files copied into each one. With full control over naming.

Bulk create Google Drive folders with optional files, from a Google Sheet

Bulk create Google Drive folders with optional files, from a Google Sheet

This post is a variation of this Bulk create Google Drive Folders and add Files tool post.

Key Functionality

  1. Maximum runtime – in order to prevent the tool from reaching the limits imposed by Google you can adjust the number of minutes the tool can run for. Change this in the ‘GlobalVariables.gs’ file in the Script Editor.
  2. Continue from where it left off – if you have a lot of Google folders and files to handle and the above runtime is reached the tool will complete the current row/folder and prompt you to run it again, without duplicating any folders or files already created.
  3. Popups – as well as the ‘Log’ sheet the tool displays a direct popup to the user if it encounters a problem.
  4. Full naming control – you have the ability to tweak every single folder and file name that is created by the tool. See the Concatenate section below to understand the true power of this.
  5. Clickable links – created by the tool which means you can navigate directly to the new folders and files directly from the Google Sheet.
  6. Add more files – the tool currently has columns for 10 files to be added to each folder, but you can actually append more as long as you follow the same convention of 2 columns per file (1 file name and 1 file ID). Do this before you run the tool as you cannot add more files to a folder once it has been created.
  7. Add more folders – after running the tool you can either choose to clear all of the data within it (use the ‘Reset sheets’ option from the ‘Admin’ menu) and start again or you can simply append further rows/folders and re-run without any duplication (if the ‘Folder Link’ column is not blank/empty then it will skip that row).

Source: The Gift of Script: Bulk create Google Drive Folders and add Files 2.0

Creating a web app with Google Sheets

A wonderful set of video tutorials showing you how to set up a web app and connecting it to a Google Sheet. It starts off with a simple form and covers areas like getting data from a sheet and sending it back and using Materialize CSS for to easily create a good looking app. Plus, it also looks at connecting a Google Calendar to the app and how to create multiple pages in the web app.

Issues reporting with translation [using Google Apps Script and Google Forms/Sheets

In this post Baz Roberts highlights the benefits of Google Apps Script Language Service to translate Google Form responses into another language.

Source: Issues reporting with translation