This file contains hidden or 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
/* | |
Loop through a folder of CSV files. | |
Capture tutor name (from file name) and code the file ID / Module Code / Group No with it in a JavaScript Object. | |
Collates/sorts all files together for each individual tutor. | |
End result is ability to loop through JavaScript Object and action CSV files | |
belonging to each tutor in-turn. | |
Collated data will look like this: | |
{Micky Mouse=[{fileId=1BRv0IhTxYxhsYbDN85DkpMqrTPyJHXyK, group=Grp 05.csv, moduleCode=CDE}, {moduleCode=CDE, fileId=1dmwVbPdwNQbOg9nfO98RD213QpKOLuqk, group=Grp 01.csv}], Jane Doe=[{group=Grp 04.csv, fileId=1z8O6jnm8INdZf9NWZBCoWTvB0zTEQDDe, moduleCode=ABC}, {moduleCode=ABC, fileId=1MnenQwueMKWssWlBOEaM8lcozB9ghYEn, group=Grp 03.csv}, {fileId=1-kh1Vp6It4LvVNSahUMkP529hu4-_es9, moduleCode=ABC, group=Grp 02.csv}]} | |
*/ |
This file contains hidden or 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
/* | |
Loop through a folder of CSV files. | |
Capture tutor name (from file name) and file ID in a JavaScript Object. | |
Collates/sorts all files together for each individual tutor. | |
End result is ability to loop through JavaScript Object and action CSV files | |
belonging to each tutor in-turn. | |
Collated data will look like this: | |
{"Jane Doe":["1-kh1Vp6It4LvVNSahUMkP529hu4-_es9","1z8O6jnm8INdZf9NWZBCoWTvB0zTEQDDe","1MnenQwueMKWssWlBOEaM8lcozB9ghYEn"],"Micky Mouse":["1BRv0IhTxYxhsYbDN85DkpMqrTPyJHXyK","1dmwVbPdwNQbOg9nfO98RD213QpKOLuqk"]} | |
*/ |
This file contains hidden or 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
/* | |
Sort through an array and remove any duplicate values. | |
Does not account for changes in case-sensitivity. | |
*/ | |
function removeDuplicates() { | |
// array of duplicates | |
var rawArray = ['Dave', 'Jim', 'Dave', 'Nicky', 'Nicky', 'Bob', 'Bob', 'Bob']; |
This file contains hidden or 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
/* | |
Testing the ability to search a 'Catch' error message and display a specific | |
one based upon it. | |
*/ | |
function breakMe() { | |
try { |
This file contains hidden or 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 createSheets() { | |
try { | |
// log event | |
logEvent("Starting 'createSheets' Function"); | |
// get the 'Welcome' Sheet |
This file contains hidden or 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
/* | |
Get values from the Spreadsheet to pass to other Functions. | |
*/ | |
function getSpreadsheetData() { | |
logEvent('Starting script.'); | |
// update status cell | |
statusUpdate('Process is running', '#ff9900'); |
This file contains hidden or 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
/* | |
Get Survey - https://api.qualtrics.com/73d7e07ec68b2-get-survey | |
*/ | |
function getSurveyDetails() { | |
// Qualtrics API Token: Qualtrics > Account Settings > Qualtrics IDs > API Token | |
var apiToken = 'YOUR API TOKEN HERE'; |
This file contains hidden or 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
/* | |
The following Google Apps Script is designed to loop through a folder of CSV files in Google Drive, extract the data, create a Google Sheet file per CSV, and insert the data into specific rows/columns. | |
*/ | |
function createSheets() { | |
// get template Google Sheet for copying | |
var templateSheet = DriveApp.getFileById('1Rj-TGRW01kx7TEVU-nXywn0yJ1GC96pgegWnuJ0Vtag'); |
This file contains hidden or 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
/** * @OnlyCurrentDoc */ | |
function autofill() { | |
// get active sheet | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
// get last row of data for later pasting into | |
var lastRow = sheet.getLastRow(); |