This tutorial is available for all users. Start with a 7 Day Free Trial today and get access.
Hey there stranger!
Let's not be strangers any more. Start a FREE TRIAL today to view this tutorial, right now.
OnInstall to onOpen
About this Tutorial
0:10 And at that moment is what starts the trigger of onOpen. And we will literally go to my Spintax one, and we'll just copy this function on open.
0:21 And we're just going to copy that and put it into our code here. We're still naming this code.gs. You can rename your code if you want.
0:30 But we have this show alert that we're going to just, rename this alert to CPM custom, custom function by BetterSheets.
0:50 And we're going to write a little bit about how to use this right here. If you want to, you can see the whole thing.
0:58 It's just, spreadsheet. .getui, um,.alert, and then we have this button set, and we just need okay. This is fairly simple.
1:09 It just looks like a lot. This is the custom function you can use to calculate CPM or cost per, Okay, that's all we're gonna write.
1:24 So whenever this sheet is opened, it will create an add-on menu here. When we deploy it, we're gonna see this we will see this up here new deployment.
1:34 We will see it in extensions right here. This is different than a menu item. That is next to the help function, or help menu item.
1:45 That is what I have done previously in other videos and stuff on the unopened and creating this custom menu. And that's really cool, and you can add your app scripts to use that extra menu, and you can even create I think an add-on that creates that menu as well.
2:02 But we want to make sure that actually, no, I don't think you can do a custom menu on the side here.
2:07 It has to be here, and it'll show up all along here. Help will be here. That is just we'll write that in the marketplace, I think.
2:19 And here's all the functions you can use. It's button styles and sheet styles both show a sidebar. So it's, this is where your users will use this.
2:29 And this onOpenSpreadsheetApp.getUI.createAddOnMenu and then addItem addToUI. We can add other items that have other functions if we want. For now, we are keeping it simple.
2:41 And hit save and that is adding the onOpen. Next video we'll do on install.
Introduction to Google Sheets™ Add-on Course
What is an add on? What problems can it solve?
MAKE IT WORK
Write Apps Script to Create a New Google Sheets Formula
Add Autocomplete with Custom Function
How to Name Your Add-on
MAKE IT USABLE
Add-on menu on open
OnInstall to onOpen
Apps Script Manifest
Connect to a Google Cloud Project
OAuth Consent Screen
MAKE IT DISCOVERABLE
Add-on Logo Design
Add-on Banner Design
Add-on Web Site
MAKE IT MARKETPLACE-ABLE
Check Add On Works
OAuth Consent Screen Video
Complete the OAuth Consent Screen
OAuth - Action Needed
OAuth Approval Request Granted
Marketplace SDK Install and App Configuration
Marketplace Store Listing
Submit Store Listing for Approval