Skip to content
var SHEET_NAME = 'Sheet1';
* Add a row of data to a sheet.
* @param {Object} parameters passed from script.
* @return {Object} result.
function setData(parameters) {
View quickstart.html
<script src="//"></script>
<title>Google Sheets as a Database – Authenticated INSERT with Apps Script using Execution API - Working Example</title>
<script type="text/javascript">
// Your Client ID can be retrieved from your project in the Google
// Developer Console,
// Modified from
function emailCharts(sheet,emails,emailSubject){
var charts = sheet.getCharts();
to: emails,
subject: "ERROR:"+emailSubject,
htmlBody: "No charts in the spreadsheet"});
function getResults() {
var connector = {'username':'YOUR_SITE_USERNAME',
var creds = {};
creds[connector.connectorDomain] = {
View code.js
// Copyright 2015 Martin Hawksey. All Rights Reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
View OpenBadgesSender.js
var BASE_URL = ''; // Google Sites page
// for script to handle issuing badges see
* Handle form submit
function onSubmit(e) {
var doc = SpreadsheetApp.getActiveSpreadsheet();
var sheet = doc.getSheetByName("IssuedBadges"); // note: assumed sheet name
var email = e.namedValues['Email'][0]; // note: assumed question name with person's email address
var uid = getUID();
View gist:258608abc8f3286e9ba5
View code
function sendEmail(e) {
var emailTo = e.namedValues['20. Email confirmation (and badge)'][0];
if (emailTo != ""){
var text = 'Thank you for taking time to complete the ALT Annual Survey 2014. You can help us get a better understanding of how learning technology is used across sectors by sharing this link to the survey with your community:\n\nYou might also use this suggested text in a tweet:\n\n " Just completed the ALT Annual Survey 2014 exploring use of learning technology across sectors. Have your say #altc "';
var textHtml = HtmlService.createHtmlOutputFromFile('mailText').getContent();
"Thank you for completing the ALT Annual Survey 2014",
{replyTo:"", htmlBody: textHtml});
View assertion
Remote Address:
Request URL:
Request Method:GET
Status Code:302 Moved Temporarily
Request Headers
Provisional headers are shown
User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.38 Safari/537.36
Query String Parametersview sourceview URL encoded
View gist:c2117b6d0e39a9f0fec4
// this function handles the form submit
function addVideoToPlaylist(e){
// 'Youtube url' is the question title from our form. If you change your question change this value
// youtube_parser() takes the url and strips the video_id
var id = youtube_parser(e.namedValues['Youtube url'][0]);
var desc = e.namedValues['Comment'][0]; // if you would like to add a note with playlist item add form field
addToPlaylist(id, desc);
// This function is taken from the YouTube API doc (Javascript example)
Something went wrong with that request. Please try again.