Join Scott Simpson for an in-depth discussion in this video Building custom functions, part of Learning Google Apps Script.
- Let's switch gears now and start working with…container-bound scripts.…These, as you'll remember, are scripts that operate…within a particular container such as a document,…spreadsheet or form.…It's really handy to be able to add custom functions…to spreadsheets, so let's take a look at that.…I'll create a new spreadsheet…and I'll call it My other spreadsheet.…Now to get to the script editor within this container…I'll go to Tools, Script editor.…
There's a couple templates here on the left that…I encourage you to explore.…There's a Google Sheets Add-on template…and a Custom Functions in Sheets template…but for now, I'll just choose Blank Project.…A custom function can do pretty much anything you'd like…from adding a convenient conversion such as kilometers…to miles to any kind of custom logic…you need to have happen in your spreadsheet…and don't want to build into an expression…every time you use it.…So a custom function will take some inputs.…In this case I'll add a and b as inputs to this function.…
Then inside the function I'll do some kind of operation.…
First, learn how to use simple scripts to edit documents and spreadsheets, work with files in Drive, and find and send messages in Gmail. Then find out how to add custom functionality to your spreadsheets, and build user interface elements for your scripts, using menus, alerts, and dialogs. Finally, Scott shows how to share your work with others by publishing scripts as web apps.
- What is Google Apps Script?
- Understanding script types
- Logging and debugging your scripts
- Scripting common tasks
- Building custom spreadsheet functions
- Creating add-on functionality such as dialogs and sidebars
- Sharing your script as a web app