AppsScriptPulse

Benchmark: Process cost for HTML Template using Google Apps Script

Image credit: Kanshi Tanaike

When we use HTML in the Google Apps Script project, in order to show the values from the Google Apps Script side, the HTML template is used. When I used the HTML template with a large value, I understood that the process cost can be reduced by devising a script. In this report, I would like to introduce the process cost of the HTML template using the benchmark.

A great feature of Google Apps Script is the ability to create and serve custom HTML, often used to interface data you have in Google Workspace such as Google Sheets. Google highlight a coupe of different ways you can mix Apps Script code and HTML. Some of these ways are better in terms of process time and this report from Kanshi Tanaike highlights the cost of calling Apps Script functions as scriptlets in HTML templates. The good news is you can avoid delays in your web app rendering by making asynchronous calls with google.script.run, which you can read more about in Google’s best practices documentation.

Update: I’ve replicated this benchmark (smaller dataset) with google.script.run and it was only marginally slower (0.3s) than the ‘create HTML table with Google Apps Script’:

Source: Benchmark: Process cost for HTML Template using Google Apps Script

Combining Google Apps Script with Google AppSheet

Combining Google Apps Script and AppSheet

In this blog I am going to show you how to combine Google Apps Script with Google AppSheet to make automation even more powerful.

Whilst Google AppSheet is marketed as a ‘no-code’ development platform for coders there have been a number of ways to add some customisations to AppSheet apps. Previously webhooks were the main way you could do this, but the recent Apps Script connector for AppSheet makes it possible to call and if required pass parameters from AppSheet into custom Apps Script functions.

If this is something you would like to learn more about Aryan Irani has continued his AppSheet tutorial series on Medium with this post which goes through the step-by-step process for setting up and using Apps Script code in AppSheet. Click through the source link to find out more.

Source: Combining Google Apps Script with Google AppSheet

Working with the Google Drive API Revisions history: Tips for handling revision merges with Google Apps Script

Having spent quite a bit of time working with the Google Drive API Revisions resource in this post I thought it would be useful to share some of the lessons and solutions I’ve picked up along the way. For this I’ll be sharing code snippets for interacting with the Revisions resource with Google Apps Script, but the solutions discussed could easily be applied to your programming language of choice.

Source: Working with the Google Drive API Revisions history: Tips for handling revision merges

How to access an API with Google Apps Script and API calls and Google Sheets manipulation

In this video you will learn how to access an API with Google Apps Script.

Chanel Greco has created this video tutorial which walks through some different ways you can interact with other sites with Google Apps Script to get data into Google Sheets. For the tutorial Chanel uses the Weather API and by coincidence Luxman Ravindrakumar has also shared a similar tutorial on Medium explaining how to use the OpenWeather API. So if you prefer learning by watching or reading you’ve no excuses :). Check the sources links below for both tutorials.

Sources: How to access an API with Google Apps Script (YouTube) and API Calls & Spreadsheet Manipulation With Google Apps Script

Make software development much more agile with Google Workspace [Google Chat apps and Add-ons]

Image credit: Google

Learn how developers use Google Workspace to centralize and integrate all of their favorite Agile and DevOps tools like Jira, GitHub, Datadog, and PagerDuty.

From the Google Cloud Blog you can learn how Google Workspace is being used to make software development more agile. For Google Workspace developers this includes a number of products you might want to consider. Additionally, this post is a great way to see how Google Chat apps and Workspace Add-ons are being seamlessly integrated to expand the functionality of Google Workspace. If you haven’t recently looked at the opportunities with developing Google Chat apps you probably should…

Source: Make software development much more agile with Google Workspace | Google Cloud Blog

A tiny Google Apps Script tool to synchronize Google Drive permissions which can also process large amounts of data

Image credit: Inclu Cat

Are you using Google Drive to share information with your staff? As the number of staff members increases, it can become increasingly difficult to manage permissions properly. I faced a similar issue. As the members of the team changed from time to time, setting access rights for each folder became a cost that could not be ignored. So I used Google Apps Script to create a tool to synchronize the permissions management table with the actual permissions.

We’ve previously featured Inclu Cat’s posts on ways to deal with Google Apps Script’s 6-minute execution limit [Ref 1 & Ref 2]. These posts continue to prove to be incredibly popular and usually feature in our most read list. Even if you aren’t interested in programmatically managing Google Drive file/folder permissions this post is a nice example of using the authors LongRun solution to process large amounts of data with Google Apps Script. From the source link you can find the GitHub repo with all the code you need and setup instructions.

Source: [Google Drive] A tiny tool to synchronize permissions

Developing robust applications with Google AppSheet: A bundle of tutorials and resources

Recently, I got the chance of giving a training on Google AppSheet at O’Reilly Media, Inc. … This was a three hour long training where I talked about the basics of Google AppSheet and how to create apps on Google AppSheet.

Aryan Irani has shared a really helpful post with highlights from an O’Reilly Media hosted course he led focusing on ‘Developing Robust Applications with Google AppSheet’. The post links to a number of other tutorials Aryan has published on how to create various AppSheet based applications including an Expense Tracking App, Vehicle Inspection App, Inventory Management App and more. Aryan touches on how Google Apps Script can be used in combination with AppSheet. If this is a topic you are interested in Chanel Greco recently highlighted a Google I/O session on the topic.

Source: My First Online Training: Developing Robust Applications with Google AppSheet

Removing Google Drive file access permissions via a Google Apps Script Web App

Remove a users edit access to a Google Drive file via an Apps Script Web App.

Web App code sample

Web App code sample

The following Google Apps Script is designed to remove a person’s edit access from a Google Drive file via a Web App. The reason for using a Web App in this instance is because removing a person’s access to a file whilst they are running Apps Script code typically results in an error (or most certainly the inability to cleanly end the code). In the project I was working on prior to this step the code needs to send some automated emails before finishing with removing the person’s access.

Source: The Gift of Script: Remove File Access via a Web App

Connecting ‘Tweet counts’ (or other APIs) to Data Studio using a Community Connector

A community connector with overridable config parameters to track recent Twitter trends for a query.

For the most part this connector is pretty similar to the one I’d created for visualising global stats of SendGrid user’s email statistics but with a key difference of making use of overridable config parameters — this is what gives the connector the capability to accept a query from the report directly and return/visualize the data based on a user’s input

This post from Sourabh Choraria is a useful reminder of what is possible with Data Studio Community Connectors, in this case connecting to the Twitter API v2 to visualise the tweet count for a defined search term.

The code for this connector is available from the source post and includes lots of inline comments to help you work out what is going on making it easy to modify if you have other APIs you would like to connect.

Source: Connecting ‘Tweet counts’ API to Data Studio using a Community Connector

Syncing handwritten notes from reMarkable 2 to Notion [or A.N. Other via your Gmail inbox with a little Google Apps Script] 

Use Google AppsScript to automatically sync your reMarkable notes via Gmail to Notion.

Not the first example I’ve seen where the lack of API’s or other suitable integrations leads someone to using their inbox as an interface to move data around. This is a nice script example for moving handwritten notes made using reMarkable to project management and note-taking service, Notion. If you are not a Notion user it would be easy to send notes to another destination like Tasks, Sheets or a different external service like Coda.

[Aside: Yesterday in Pulse we highlighted some work by Pablo Felip on Coda webhook-based automations with Apps Script. This resulted in a useful discussion on Twitter with Coda developer advocate Eric Koleda about when best to use Coda’s webhooks:

So if you are a Coda user you might want to look at reMarkable -> Gmail -> Apps Script -> Coda webhook :)]

Source: Syncing from reMarkable 2 to Notion