Skip to content

Instantly share code, notes, and snippets.

View jhned's full-sized avatar

Josh Nederveld jhned

View GitHub Profile
@jhned
jhned / advanced-data-validation-for-properties-based-on-type.js
Last active April 27, 2020 16:51
Filter Schema Properties Based on Type
// onEdit is a simple trigger
// https://developers.google.com/apps-script/guides/triggers
function onEdit(e) {
// Use Logger to log values, e.g., Logger.log(e)
// https://developers.google.com/apps-script/guides/logging
if ('' === e.value ) { // If the cell was cleared out, don't do anything.
return false;
}
@jhned
jhned / generate-schema-from-spreadsheet.js
Last active April 27, 2020 17:46
Generate Schema from Spreadsheet
// Runs when the spreadsheet is open.
function onOpen() {
const spreadsheet = SpreadsheetApp.getActive();
// Add a menu item, a button and a callback function.
const menuItems = [
{name: 'Generate JSON', functionName: 'generateSchemaJSON_'}
];
spreadsheet.addMenu('SCHEMA', menuItems);
}