This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Make reports in Google Docs from data in a Google Sheet, then email them as PDFs | |
function makeSendReports() { | |
const ss = SpreadsheetApp.getActiveSpreadsheet(); | |
const sh = ss.getActiveSheet(); | |
const [header, ...data] = sh.getDataRange().getDisplayValues(); | |
const group = header[0].split(" - ")[0]; | |
const teacher = header[0].split(" - ")[1]; | |
const docMaster = DriveApp.getFileById('12MEOOsfFrxsQzBXqDe0gOTacncpaDoykTuWgoT5rzqI'); | |
const placeholders = ['#NAME#', '#GROUP#', '#TEACHER#', '#READING#', '#WRITING#', '#SPEAKING#', '#LISTENING#', '#OVERALL#']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bound to a Google Sheet | |
//SCRIPT 1 | |
function getData() { | |
const ss = SpreadsheetApp.getActiveSpreadsheet(), | |
shResults = ss.getSheetByName('RESULTS'), | |
results = shResults.getDataRange().getValues(); | |
//Get appropriate week data (months 0-11) | |
const wk1 = new Date(2021, 1, 6), | |
wk2 = new Date(2021, 1, 13), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Stand alone script file | |
//SCRIPT 1 | |
function doGet() { | |
//Get talks | |
var ssConf = SpreadsheetApp.openById('SPREADSHEET ID'); | |
var shTalkInfo = ssConf.getSheetByName('TALKINFO'); | |
var allTalkInfo = shTalkInfo.getDataRange().getValues(); | |
allTalkInfo.shift(); | |
//Build form |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bound to a Google Form | |
//SCRIPT 1 | |
//Get talks from form submission | |
function getFormSubmission(e) { | |
const form = FormApp.getActiveForm(); | |
//Get list of talks selected | |
const lastRespNo = form.getResponses().length - 1; | |
const latestResp = form.getResponses()[lastRespNo]; | |
const listOfTalks = latestResp.getItemResponses()[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bound to a spreadsheet | |
//SCRIPT 1 | |
function makeCerts() { | |
const ss = SpreadsheetApp.getActiveSpreadsheet(), | |
shCerts = ss.getSheetByName('CERTIFICATES'), | |
data = shCerts.getDataRange().getValues(); | |
//Column array references and row numbers | |
const startRowNum = data[0][4], endRowNum = data[0][6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SCRIPT 1 | |
function makeReports() { | |
//Get data | |
var ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sheet = ss.getActiveSheet(), | |
data = sheet.getDataRange().getValues(), | |
company = data[0][0]; | |
data.splice(0, 2); | |
//Get report template and report folder IDs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SCRIPT 1 | |
function makeReports() { | |
//Get data | |
var ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sheet = ss.getActiveSheet(), | |
data = sheet.getDataRange().getValues(), | |
company = data[0][0]; | |
data.splice(0, 2); | |
//Get report template and report folder IDs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SCRIPT 1 | |
function makeInvoice() { | |
//Get invoice data | |
const ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sh = ss.getSheetByName('INVOICES'), | |
fInvoices = DriveApp.getFolderById('FOLDER ID'), | |
timeZone = Session.getScriptTimeZone(), | |
data = sh.getDataRange().getValues(); | |
var invoiceNumb = data[0][6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeInvoice() { | |
//Get invoice data | |
const ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sh = ss.getSheetByName('INVOICES'), | |
invoiceTemp = DriveApp.getFileById('DOCUMENT ID'), | |
fInvoices = DriveApp.getFolderById('FOLDER ID'), | |
timeZone = Session.getScriptTimeZone(), | |
data = sh.getDataRange().getValues(); | |
var invoiceNo = data[0][6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CHAPTER 3 - Bound to a Google Sheet | |
function makeSalesQuotes() { | |
//Get quote data, master, folder & timezone | |
const ss = SpreadsheetApp.getActiveSpreadsheet(), | |
sh = ss.getSheetByName('QUOTES'), | |
quoteMaster = DriveApp.getFileById('DOCUMENT ID'), | |
fQuotes = DriveApp.getFolderById('FOLDER ID'), | |
timeZone = Session.getScriptTimeZone(), | |
data = sh.getDataRange().getValues(); | |
data.splice(0, 2); |
NewerOlder