Skip to content

Instantly share code, notes, and snippets.

@mrlynn

mrlynn/OnOpen.js

Created Mar 3, 2019
Embed
What would you like to do?
Google Sheet Script to Create a Menu Item OnOpen - part of Stitching Sheets blog article
/****
* 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
You can’t perform that action at this time.