AppsScriptPulse

Report: Implementing a pseudo 2FA for Web Apps using Google Apps Script

In Google Apps Script, there is the Web Apps. When Web Apps is used, the users can execute Google Apps Script using HTML and Javascript. This can be applied to various applications. When the Web Apps is deployed with “Anyone”, anyone can access the Web Apps. And, there is the case that Web Apps deployed with “Anyone” is required to be used. Under this condition, when 2 Factor Authentication (2FA) can be implemented, it is considered that the security can be higher and it leads to giving various directions for the applications using Web Apps. In this report, I would like to introduce the method for implementing the pseud 2FA for Web Apps deployed with “Anyone” using Google Apps Script.

There can be scenarios where you’d like to publish an Apps Script web app with ‘anyone can access’, but still provide a level of security. Here’s a nice example from Kanshi Tanaike where they use MailApp to email the user a a time limited random passcode.

Magic links and passwordless login are used by a number of services, including Slack, and rather than including a password, as demonstrated in this example, it wouldn’t take much to turn this solution into a passwordless app. There are risks associated with email based authentication and if an attacker already has access to your email so other solutions are worth considering depending on the sensitivity of your web app.

Source: Report: Implementing Pseudo 2FA for Web Apps utanaikech.github.iosing Google Apps Script

Get hidden or visible Google Sheet tabs with Google Apps Script

Learn how to list hidden Google Sheets tabs with Google Apps Script – CODE and VIDEO tutorial with script explainers.

This post from Scott Donald is an opportunity to learn about how you can work with hidden tabs in Google Sheets with Apps Script. For beginners this post is also an opportunity to learn about the JavaScript reduce method as a way to iterate through data. As well as the code and supporting video the author Scott Donald has some related projects where you can see this solution in action.

Source: Get Hidden or Visible Google Sheet Tabs with Google Apps Script – Yagisanatode

[Workaround] An alternate to displaying more than 100 widgets/sections in a Google Workspace Add-on

Working around the 100-widget limit in Card Services, used when building Workspace Add-ons.

Like it says on the tin a way to display more than 100 items in a Google Workspace Add-on. The solution also has a nice UX friendly search feature to make it easier to find stuff in the UI. The source post from Sourabh Choraria includes additional information and links to the code on GitHub.

Source: [Workaround] An alternate to displaying more than 100 widgets/sections.

Tech Recruiter Tries Coding pt. 2 — Google Apps (Type)Script

Image credit: Unknown

Talking CRMs, Databases, and how to ditch them; this time within the Lead Generation domain. Bonus: pitfalls of a 90s computing mindset! 😅

Previously on Pulse we shared Rafael Romo Mulas’ post, Tech Recruiter Tries Coding. Rafael has recently published part 2 in which they highlight their journey into VS Code, clasp and TypeScript. If you are unfamiliar with TypeScript its a language which transpiles into JavaScript and basically designed to help you write better code. Rafael notes:

… the main difference is you are forced to be more precise, which avoids running into stupid errors! Therefore, to my surprise, it is actually easier to code in TypeScript than JavaScript, even more so for a beginner like me, because:

  • There is not much to “unlearn” from JS, if you just started anyway.
  • You’re alerted when values can be of a type that would cause errors.
  • You’re forced to do something about it, basically debugging in advance.

You can read more about Rafael’s journey in the linked article

Source: Tech Recruiter Tries Coding pt. 2 — Google Apps (Type)Script

r/GoogleAppsScript – AutoScript – create Google Apps Script code with help of AI #nocode

I’ve seen a couple of proof of concept solutions for AI generated Google Apps Script code, but this one is the most well developed I’ve seen to date. The AutoScript Add-on isn’t fully verified so if you are trying this out I would recommend using disposable credentials (as a Google Workspace admin I created/used a Cloud Identity account). I’ve only done limited testing but was able to get the add-on to generate a functional Google Apps Script code snippet. Simultaneously both amazing and scary to think a chunk of what I do for a living could be replaced by one of our robot friends.

Highlights from the Google Workspace Developer Summit 2022 – The state of Workspace development is good!

Busy old couple of weeks at CTS and it’s been nice to get back to some face-to-face events. Last week I had the pleasure of joining the Google Workspace DevRel team on stage at the Google Workspace Developer Summit, London co-presenting with some guy called Charles Maxson.

A couple of years ago as part of Totally Unscripted we did a ‘State of Script‘ episode with then Apps Script PM Keith Einstein. This latest clip from the Google Workspace Developer YouTube channel captures not just the state of script, but the wider state of Workspace Dev.

The clip is worth a watch to get a summary of some of the new features coming to Workspace development. For me, not only is there plenty to get excited about my overall feeling from the Summit was Workspace development is now a first class citizen in the Google Cloud family. The state of Workspace development is good!

Source: Highlights from the Google Workspace Developer Summit 2022!

Apps Script added a new method to the Utilities class parseDate(date, timeZone, format) | Release Notes  | November 3, 2022

Apps Script added a new method to the Utilities class. parseDate(date, timeZone, format) parses a provided string date according to the specification described in the Java Standard Edition SimpleDateFormat class.

Given the popularity of handling data using Google Apps Script I’m sure many will welcome the inclusion of a parseDate() method which was included in the most recent release notes.

Source: Release Notes  |  Apps Script  |  Google Developers

Develop a Google Chat App Currency Converter with Google Apps Script – Yagisanatode

Have you ever wanted to convert currencies instantly while in Google Chat with colleagues and clients? In this tutorial, we are going to build a Currency Converter Google Chat App with Google Apps Script to do just that.

This tutorial is a multi-media series containing step-by-step video instructions for each stage of the process along with code snippets for each stage, important links and some further details on the more unusual parts of the code.

This is a great video series wrapped in a blog post, which highlights a Google Chat app development process. The particular project presented by Scott Donald is a currency converter but there are many repeatable aspects that would work in a wide range of Google Chat applications. The project is coded in Google Apps Script and the post includes plenty of snippets to help you understand various aspects of Google Chat app development including slash commands and information cards.

Source: Develop a Google Chat App Currency Converter with Google Apps Script – Yagisanatode

Workaround: Checking Existence of File ID in Google Drive without Access token and API key using Google Apps Script

This is a workaround for checking the existence of file ID in Google Drive without both the access token and API key.

When you want to check whether the file of the file ID is existing in Google Drive, generally, you might use Drive API and Drive service (DriveApp) of Google Apps Script. In this case, the scope of Drive API is required to be used. By this, the access token and the API key (in the case of publicly shared files) are required to be used. But, there might be a case that the available scopes are limited. In this post, I would like to introduce a workaround for checking the existence of file ID in Google Drive without both the access token and API key.

This workaround could have been a nice addition to a recent project I was working on to audit a bunch of Google Drive file IDs. As noted in this post a big benefit of the approach is there is no need to include Google Drive authentication scopes to your project. See the source post for the code and explanation.

Source: Workaround: Checking Existence of File ID in Google Drive without Access token and API key

How to monetize your Google Workspace add-on?

You’ve built a great add-on for the Google Workspace ecosystem (Google Docs, Google Sheets, Gmail & co.). It’s getting a lot of traction and you feel like you can monetize it. This is the guide I wish I had found a few years ago when I was researching how to monetize our own add-on for Google Sheets.

Here is a very concise and incredibly useful guide written by Corentin Brossault, co-founder and CTO at Mailmeteor, on the practical steps you can take if you are interested in monetizing your Google Apps Script solution. The post includes some code snippets and guidance on protecting personal information of your users, storing licence data in Firebase and integrating with Stripe as a payment processor.

Source: How to monetize your Google Workspace add-on?