AppsScriptPulse

Simple and maintainable error-handling in TypeScript

Sometimes things fail — that’s a fact of life and programming. So as a programmer, you’re going to have to write error-handling code. Thankfully TypeScript has some handy features which can help us to create simple and maintainable error-handling code.

James Elderfield recently joined us on Totally Unscripted to share some insights into the infrastructure used at Supermetrics used to support the development of their Google Sheets Add-on and Data Studio Connector. As part of their stack James highlighted how they used TypeScript to write code complied to use in Google Apps Script. This post isn’t Apps Script specific but provides some useful tips on using TypeScript for error handling.

Source: Simple and maintainable error-handling in TypeScript

Github as an Apps Script cache platform – Desktop Liberation

Use Github as a back end for caching large objects across platforms. It’s possible to use a github repo as the back end for a caching service, and by taking this approach we can share data between Apps script and multiple platforms. It also means you can retrieve the data with the git CLI in addition. It works in exactly the same way as all the other backends. … Using a regular git Repo means you can make it private and share it using the tools already built into Github.

Source: Github as an Apps Script cache platform – Desktop Liberation

Creating a Google Chatbot connected to SAP Graph API

You know that idea you always keep at the bottom of your backlog for that elusive day you’ll find enough time to address? For me, it’s the possibility to connect a chatbot to an SAP system.

Julien Delvat shares how you can connect the SAP Graph API to Google Chat with Google Apps Script. The post provides details of the entire development and deployment process with useful tips on how you can extend the project.

Source: Creating a Google Chatbot connected to SAP Graph API

Analyze your friends Peloton workout stats with real-time updates (using Google Apps Script)

A tutorial on how you can sync and analyze your Peloton workout stats into Coda with custom dashboards. Sync with a Google Apps Script or serverless function on Google Cloud.

We’ve featured this example from Al Chen on interacting with Peleton data with Google Apps Script before. Al has recently updated the post to include a “new table ‘Friend Workouts’ contains latest 10 cycling workouts from people you follow”. Follow the source link for more details…

Source: Analyze your Peloton workout stats with real-time updates

Modern Angular in Google Workspace Editor Add-ons

I intend this post for established Add-on developers who want to use Angular in Google Workspace editor Add-ons and Google Apps Script webapps. This does not attempt to show how to create Add-ons or Angular apps, but the tooling and build process to use Angular apps in Add-ons. I am also assuming familiarity with installing and using CLI tools in your development workflow.

We recently had the author of this post, Spencer Easton, on an episode of Totally Unscripted to talk about this topic. This companion post provides an overview of using Angular for Add-on development. There is a cost associated with this solution has separate hosting is required for the Webpacks, but as covered by Spencer the cost is low (for a 100K+ users add-on the cost is $8/month).

Source: Modern Angular in Google Workspace Editor Add-ons

Maintain Google Apps Script in an Enterprise environment – Google Apps Script deployment with Cloud Build

In this article I will showcase the way I deploy Google Apps Script code in an Enterprise environment. I will share the actual build file and the necessary steps and tools to reproduce my workflow. This approach does require Google Cloud Platform knowledge and a credit card. The instructions are high level, this article is not a codelab.

For those interested in scaling up their Google Apps Script development Jasper Duizendstra outlines how you can use Google Cloud Build for version control and Continuous Deployment (CD). As Jasper notes:

When the CD pipeline is in place it becomes easy to deploy the script, separate the responsibilities and support multiple versions and implementations of the code …  the most important advantage of using CD is the mindset that it enables. It provides an environment where I feel confident and safe to create small incremental changes in my applications.

Source: Google Apps Script deployment with Cloud Build

Use Google Cloud AI to find the right answers from the Calendar TV contest

I have programmed an application that searches for (or rather knows) the correct answers to the competition questions from the Kalendárium program, all using Google Cloud AI. I decided to write the entire application in Google Apps Script technology, which offers an online IDE editor, application operation in the cloud and the possibility of a quick connection to Google services. [auto-translated]

You’re going to have to hit Google Translate to read this post from Ivan Kutil, but it’s worth it is a nice example of how Google Apps Script can be used for orchestration. All the details are in the post and it’s also a nice reminder of the Parser library Ivan released in 2016, which makes it easy to scrape data from websites using UrlFetchApp (read more about the web scraping).

Source: Využití Google Cloud AI pro hledání správných odpovědí z televizní soutěže Kalendárium

Everything you ever wanted to know about Gmail draft inline images and Google Apps Script but were afraid to ask

Image order in Gmail draft

A common workflow solution in Google Apps Script is to use a Gmail draft message as a template for sending emails. For the user the benefit is they can draft a message in a familiar environment adding formatting without having to worry about writing HTML. A problem often encountered is the inclusion of inline images. This post looks at solving the issue of missing inline images.

Source: Everything you ever wanted to know about Gmail draft inline images and Google Apps Script but were afraid to ask – MASHe

Analyze your Peloton workout stats with real-time updates (template and scripts) – Google Apps Script

A tutorial on how you can sync and analyze your Peloton workout stats into Coda with custom dashboards. Sync with a Google Apps Script or serverless function on Google Cloud

Nice post from Al Chen for Peloton users keen to add to their ‘quantified self’ pool of data. This post might be of particular interest for community members interested to see how authentication cookies can be handled with UrlFetchApp.

Source: Analyze your Peloton workout stats with real-time updates (template and scripts)

How to write a custom function library for Google Sheets

In this article I will showcase one of the many ways you can customize your Google Workspace environment. We will implement two custom functions in Google Sheets. With these functions as an example I will demonstrate how to use Google Apps Script Libraries to organise and distribute your solution. There are multiple ways to distribute your Apps Script code within the Google Workspace, and this article will help you decide if this library method is right for you.

Always nice to have some advanced techniques in your toolbox. In this example from Jasper Duizendstra he explores how custom functions in Google Sheets can be packaged and used in Libraries.
Source: How to write a custom function library for Google Sheets