Posts

Showing posts from September, 2018

Looping Through Data

Image
I don't know about you, but I often organize students with google sheets. I use rows for each student and columns for information related to the student. Sometimes I need to push this informatiuon back to students or parents. Sometimes I have do something else with the information. It’s helpful to know how to get the data and work with it in a loop.
Spreadsheets are a two dimensional arrays. There is information in Rows, dimension 1,  and information in columns, dimension 2. We can target each cell by knowing the proper row and column.
We can also loop through each row and do something with the data.
Computers start counting from 0. Google Sheets starts counting the informational rows and columns from 1. I will also use my own label in row 1 to identify the column number. This way I can insert columns and move them around and still retrieve the same information. Let’s start with identifying the columns by our own labels and setting the column number to a variable which makes sens…

World’s Maker Faire

Image
My favorite toy as a kid was a box. Small boxes, large boxes, any shape boxes. I loved to imagine them as something else. What could I make out of this box?  I was lucky to be from a family of printers. I had an endless supply of boxes and paper to play with growing up. When you are taken to work on weekends so your mother can do the bookkeeping you have to find something to entertain yourself. I played with paper and boxes.  Seeing the World Maker Faire this weekend I was brought back to my experimentations as a youth. I’m always inspired to make. If I wasn’t in a NYC apartment I’d have a garage or workshop specifically for making things. While wandering through the numerous exhibits watching kids stare in wonder I was struck by a few thoughts.  What keeps us from providing opportunities for our students to create in class? We pack our curriculum with information and practice. But what about personal pursuits just for the sake of it? Teaching at LaGuardia high school I saw making in the…

Send an Email with a Function: Part 2

Image
There are times that automated email can be very helpful. The concept I'm going with here is aligning to a form response. When we ask folks to sign up for something we sometimes need them to have materials or may want to customize the response. Yes, in Forms you can customize a response to the form but what if you want to get fancy? Say people are filling out a form for an audition (I was in the entertainment industry so I'm using an example personal to me) they are going to need to audition materials and information for the particular role they are auditioning for. Here's where a script can help you to select who receives what.

Let's go back to our form we were collecting emails on. We'll keep this simple to begin then I'll give you a case where it can be expanded.

Open the Scripts Tools>Script editor. You should have:
function formResponse(e){
Logger.log(e.values[0]);
}
Try changing it to:
function formResponse(e){
Logger.log(e.values);
}
Submit a form response…

onFormSubmit Do Something: Part 1

Image
Did you know Google Scripts can be triggered when a form submits to do something? Assigning a function to the onFormSubmit trigger and it will call that function. Let’s build one now to email a response to a submitted form.
We all have sign-ups we use with our school community. Sometimes when some one signs up we need to provide them with a document and other information. With Google Apps Scripts we can automatically send an email to the person that signed up with attachments.
Let’s explore. Start by creating a form. Be sure to turn on the Email capture or make a field for people to type their email and validate it as an email. Add any other questions to your form that you like. Keep the Allow only 1 response off so we can test with our own email multiple times.
Our script will be built in Google Sheets. IN the form responses link the responses to a new sheet. Open the sheet and select Tools>Script editor. The editor will open in a new tab. Give a name to your script. Remove the …

Google Apps Script Programming

Image
I’ve been asked a few times to teacher a course for teachers on Google Apps Scripts. So I’m going to begin talking out the structure here until I can get a class together. I'll be working with Chrome to explore Scripts.

Scripts are instructions for a computer. The are read just as they are. they are a form of coding but not all coding or programming is scripting. Some languages have to be turned into specific computer read forms. This translation is called compiling. Scripts are interpreted just as they are. Most web interactions are done with scripts. Google Apps Script uses JavaScript. Typically javascript runs in the users computer. Google Apps Scripts run in the Google Cloud on the google servers. This makes the power of it consistent despite the user's machine. For a JavaScript course check out Codecacademy. I'll be using Google Apps Scripts, the Information on javascript can be helpful for a deeper under standing but not mandatory.


Let’s open Google Apps Scripts. Sel…