In this episode of Sheets to Apps, we cover how to give newcomers access to resources via Google Forms and an Apps Script that lives in a Google Sheets, making on-boarding new employees simple and easy.
The code and other resources presented in this episode are available from the video description.
Learn how to use modern JavaScript features in your Apps Script code with the release of the Apps Script V8 runtime engine.
Somehow we missed this post from Ben Collins when it was originally published in February, 2020, but it is well worth visiting and adding to our V8 collection of posts. For those still catching up V8 is the new runtime for Google Apps Script which enables modern JavaScript syntax to be used in your code. Ben covers some of the basic differences now possible with V8, with lots of examples.
Send personalized text messages to your contacts with the help of Google Sheets and your Android phone. The SMS messages go directly from your phone SIM, no third-party SMS service is required.
Amit Agarwal (@labnol) has highlighted a really interesting model to integrate G Suite with Android mobile apps using Google Apps Script and MIT’s App Inventor. In Amit’s example he illustrates how you can quickly create your own Android app as a proxy for sending SMS messages from a Google Sheet. Given the flexibility of App Inventor this opens up numerous other opportunities to integrate G Suite and your Android phone.
The Coronavirus (COVID-19) tracker uses sparklines in Google Sheets to help you visualize the spread of the coronavirus outbreak across different states of India over time.
Apps Script doesn’t have a module loader system. If you’re used to developing in NodeJs, you’ll also be familiar with importing and exporting to include required modules in your project. With Apps Script, you have no control over the order in which multiple script files are executed. In Legacy Apps Script, there seemed to be some kind of workaround going on so that global statements were executed in a sensible order (I don’t know the details), but in V8 this is not the case. …
My golden rules are
Nothing executable should be in global space
Don’t rely on the order that things are processed
Minimize the number of executable functions (1 is good)
Always assume your code will be reused somewhere else.
V8 adds destructuring from JavaScript ES6. Legacy Apps Script already had destructuring of arrays added fairly recently, but v8 gives full a destructuring capabilitity. These destructuring and spreading capabilities, which at first may again seem a little like syntactic sugar, have contributed greatly to the development of state management frameworks such as Vuex and Redux for client side apps. V8 brings some of that cleanliness to Apps Script.
V8 adds the arrow function declarator from modern JavaScript. This is a handy shorthand but it’s more than just that. There are some behavioral differences too that you’ll need to understand before diving in. The old way of declaring functions still exists of course, and there will always be a need for it.
More tips and guidance from Bruce Mcpherson for developers migrating code to the Apps Script V8 runtime.
Sets and Maps can often be a cleaner way of storing data than using Objects or Arrays, even though at first glance they may seem a little redundant. Unlike an array, they are aware of what else is in the map or set (so you can avoid duplicates), and unlike an object, you can use anything as the key – including the item value itself
Given many Apps Script projects focus on manipulating data Bruce Mcpherson provides a useful introduction to Maps and Sets.
It’s a shorthand way of using a template into which variables are subsituted in a string. This allows for better reuse of string structures, and a few other goodies besides (like all V8 additions, it’s more than just a syntactical spruce up)
Bruce Mcpherson has a very useful post highlighting the benefits of using the new V8 runtime when working with string output
This update to Apps Script lets users take advantage of modern JavaScript features and enhances new or existing scripts with less verbose, more standardized code.
This post from Alexandrina Garcia-Verdin, better known in the community as AGV, highlights some of the benefits of the new Google Apps Script V8 runtime including succinct syntax and data processing operations: map(), filter() and reduce(). As part this AGV also highlights some of the resources from Ben Collins and Amit Agarwal put together to support the community transition to V8. A nice feature of this post from AGV is side-by-side comparisons of old and new JavaScript syntax: