AppsScriptPulse

Gmail scopes automatically invalidated when a user changes the password requiring re-authentication 

I stumbled upon this particular oddity a few weeks ago when a client asked me to resolve an issue.
It turns out that if your application leverages gmail scopes, those scopes are automatically invalidated when a user changes the password on that gmail account. The client in question had changed their password which triggered an authorization prompt. Something to watch out for.
Nice highlight from Dimu Designs, the source thread is open for other ‘gotchas’.

Source: The more you know! – Google Groups

SpreadAPI: add REST API to any spreadsheet in Google Sheets

SpreadAPI

Image: spreadapi.com

SpreadAPI is a free Google Apps Script that allows you to add REST API to any spreadsheet in Google Sheets in a few minutes. The API can be accessed over HTTPS from back-end as well as front-end apps.

It’s currently possible to publish a Google Sheet as JSON to get the data in a third-party application, but it’s harder to allow for posting new data back to that sheet. SpreadAPI is a script that creates a full-function REST API for a Google Sheet. Each implementation is set up individually and provides multiple authentication methods for specific users or even anonymous users.

Source: spreadapi.com

How to Inject Data from Google Sheets Into a Google Slides Presentation | UpBuild

Stop copying and pasting data from Google Sheets. Have it automatically injected into a Google Slides presentation with this Apps Script.

Nice introduction post which covers the basics of Google Apps Script development using a project to populate Google Slides from Sheets as an example

Source: How to Inject Data from Google Sheets Into a Google Slides Presentation | UpBuild

Send content automatically via a Google Sheet and an Apps Script | Sheets to Apps – YouTube

In this episode of Sheets to Apps, see why it can be handy to use a Google Form to help requestors receive assets like e-books or online white papers automatically by email using Apps Script.

Stripe payment code integrated into Google Apps Script

Stripe Payment Example

Regular Google Apps Script community contributor Alan Wells has provided example Apps Script code with different examples of Stripe payment integration.

Source: Stripe payment system – client version v3 – Apps Script integration 

Unit Testing in GAS Part 4: Error Handling | ohhey[blog]

Up until now, our Calcs class has handled errors with simple true and false flags. That’s not helpful to the user. At this point, we’re ready to begin defining and testing custom errors in our functions.

QUnit allows a throws method which can check for errors in your application. This tutorial post adds some error checking to a simple Apps Script project.

Source: Unit Testing in GAS Part 4: Error Handling | ohhey[blog]

Apps Script for SEOs

Get weekday name from a date

Take a date and extract the day of the week from it. By making use of ‘formatDate’ and the pattern ‘EEEE’ within a few lines of code we have a workable week-day name that could be used in an if statement as discussed in the previous post.

Source: The Gift of Script: Get weekday name from a date – alternative

Copy template sheet to Google Sheets and reorder

Template sheet with signatures to copy to other files

Screenshot of template sheet with signatures to copy to other files

Take a template Google Sheet (containing fields for 3 signatures) and copy it into other Google Sheet files within a given Google Drive folder and then reorder those sheets so that it was the first one.

The idea was based around needing users to authorise student marks with their signature from multiple Google Sheet reports produced from a third party system.

Source: The Gift of Script: Copy template sheet to Google Sheets and reorder

Dynamically remove Google Form options

Screenshot of Google Form appointment slots
Google Form appointment slots

This was developed as I wanted to learn about removing Google Form option choices as part of exploring its capabilities for use with appointment slots. I am aware there are a number of Google add-ons that achieve this but they come with potential data protection issues when accessing your Google Account, hence an in-house approach.

The principle is simply that a user would select their desired appointment slot on the Form and then that option would be unavailable for the next user accessing the Form.

Source: The Gift of Script: Dynamically remove Google Form options

Subscribe to Apps Script Pulse...