Skip to content

Instantly share code, notes, and snippets.

@nkriddock
nkriddock / conditionalform
Created September 11, 2020 14:01 — forked from alissamune/conditionalform
Creates a Google Form that can change the Confirmation Message depending on the answer to your question.
function conditionalForm() {
var sheetId = FormApp.getActiveForm().getDestinationId();
var ss = SpreadsheetApp.openById(sheetId);
var form = FormApp.openById('FORM_ID');
var item = form.addListItem();
item.setTitle('title')
.setChoices([
item.createChoice('option1'),
item.createChoice('option2'),
item.createChoice('option3')
@nkriddock
nkriddock / RSVP for food
Created September 11, 2020 14:00 — forked from ldang/RSVP for food
These are Google App scripts that will allow you to modify your Google form based on RSVPs. See here for reference: https://developers.google.com/apps-script/reference/forms/form-app
/* Here are the example Google Form and Spreadsheet associated with this code
https://docs.google.com/forms/d/e/1FAIpQLSczl18O39stzPCROGUHt6jk3yq-TFtL2rR9egS1l5Ym42OQIg/viewform?usp=sf_link
https://docs.google.com/spreadsheets/d/18B7HEbLTmu00yvT1Ss2Sn75i6rbvOx4_6-3Z2y3mfRs/edit?usp=sharing
You can make your own Google Form, and then use those identifiers to put into the function below
This particular function will report on how many people are coming to a potluck and what items they plan on contributing.
This version needs more improvement.
*/
@nkriddock
nkriddock / changeDestination.gs
Created September 11, 2020 14:00 — forked from ashayshub/changeDestination.gs
Change google form destination spreadsheet on form submit
// ***** WARNGING::: UNTESTED CODE / Failing Code ********
// Could not continue testing as I did not have a GSuite account to enable DriveApp features
function getProjDetails(itemResponses) {
// Get project and application names
for (var j = 0; j < itemResponses.length; j++) {
var itemResponse = itemResponses[j];
var question = itemResponse.getItem().getTitle();
if (question == 'What is the name of your project?')
@nkriddock
nkriddock / englist_test_1
Created September 11, 2020 13:59 — forked from agray0909/englist_test_1
2nd release
function onOpen() {
/*var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{name: 'auto translate', functionName: 'auto_translate'},
{name: 'create test sheet', functionName: 'create_test_sheet'}
];
spreadsheet.addMenu('Directions', menuItems);*/
SpreadsheetApp.getUi()
.createMenu('English Training')
@nkriddock
nkriddock / krit.gs
Created September 11, 2020 13:59 — forked from lyxuansang91/krit.gs
var sheet2 = SpreadsheetApp.getActive().getSheetByName('Sheet1');
var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1');
var sheetFindPhone = SpreadsheetApp.getActive().getSheetByName('findPhone');
var sheetCallback = SpreadsheetApp.getActive().getSheetByName('Callback');
var baseRow = 2;
var idToIgnore = [];
var shopId = 15;
var productId = [34,41,45,52,54,61,74,78];
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index');
}
function getLoc(value) {
var destId = FormApp.getActiveForm().getDestinationId() ;
var ss = SpreadsheetApp.openById(destId) ;
var respSheet = ss.getSheets()[0] ;
var data = respSheet.getDataRange().getValues() ;
var headers = data[0] ;
var numColumns = headers.length ;
/**
script adapted from https://www.youtube.com/watch?v=pXUsW6VRQak
*/
function myFunction() {
var sheetName = 'Sheet1';
var formId = '1LnmQRJX0l586EvNeXYNLujO2vqhqB-Grtfe1J5zfFWI';
var title = 'Form Title here';
var description =
'Form description here.' +
'This should really be moved to a cell in the sheet.' +
@nkriddock
nkriddock / GAS_resource_manager.gs
Created September 11, 2020 13:58 — forked from ReubenJ/GAS_resource_manager.gs
A google app script to manage the checkout process for Google resources/equipment. The script creates calendar events based on form submissions.
/**
* @author reubenj1999@gmail.com (Reuben Gardos Reid)
*
* @desc On a form submit, the script triggers, adds an event with the
* selected equipment resource invited in a master calendar. Note that
* in this implementation it is assumed that the user does not have admin
* access and the account associated with this script must be subscribed
* to all of the resource calendars; otherwise, the script will not be
* able to find the resources and will fail to invite them to the event.
*/
// Глобальные переменные
var email = Session.getEffectiveUser().getEmail(); // адрес пользователя
email = email.toLowerCase();
var date = new Date();
var SPREADSHEET_ID = "0ApcwrJ2inIl8dGxpdlJ4VGJTM0RYX1c3Ulo4b3hJbXc";
var doc = SpreadsheetApp.openById(SPREADSHEET_ID);
var s = doc.getActiveSheet();
var userName = Session.getEffectiveUser().getUsername();
var total = 0; // Общее количество баллов
var score = [ ]; // Массив отметок