Created
March 3, 2019 16:05
-
-
Save mrlynn/4bc4d6ce9104d2ab2000100a7191b53b to your computer and use it in GitHub Desktop.
Google Sheet Script to Create a Menu Item OnOpen - part of Stitching Sheets blog article
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
/**** | |
* This function runs automatically and adds a menu item to Google Sheets | |
****/ | |
function onOpen() { | |
var sheet = SpreadsheetApp.getActiveSpreadsheet(); | |
sheet.setActiveSheet(sheet.getSheetByName("Events")); | |
var entries = [{ | |
name : "Export Events to MongoDB", | |
functionName : "exportEventsToMongoDB" | |
},{ | |
name: "Remove All Events from MongoDB (Delete Documents)", | |
functionName: "removeEventsFromMongoDB" | |
}]; | |
sheet.addMenu("Demo Stitch Sheets Integration", entries); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment