In this example we get into the real power of Google Scripts: the ability to interact with Google Docs, Sheets, and more. Click here to view the Example Script 07 – Modifying a Google Doc. function myFunction() { /* The array, data, has three values: studentEmail, message, and docId */ […]
Yearly Archives: 2015
In Google Script, as in most coding, arrays are an important way of storing a series of variables. For a look at arrays in javascript, click here: http://www.w3schools.com/js/js_arrays.asp Take a look at the following example, or click here to make your own copy of the code: function myFunction() { var data […]
In this challenge, you want to pass two variables, ‘studentEmail’ and ‘message’, to the function emailStudent.To do this, you’ll need to add the variables as parameters to both the function CALL, and the function DEFINITION.Once you’ve done this, use the Logger.log command to log both variables and make sure they […]
In the previous example, there was a bit of code that was repeated twice: the Logger.log series of commands. Whenever you see code being used more than once, it’s a good sign that you need to build a new function for it. However, in order for this to work in […]
In this example we begin to look at variables. Just like in algebra, a variable can hold a range of values, but in coding they are also a little bit different. Variables in JavaScript have different types, the most basic of which are Strings and Numbers. Simply put, Strings contain […]
In this challenge, we’ll take the principles from the previous example one step further. Here, in addition to simply defining functions, we are also CALLING a function: newFunction. function myFunction() { newFunction(); } function newFunction(){ } Note here that the first function, myFunction, calls newFunction. You can tell that it […]