Academy ↓
Hey there stranger!
Sign up to get access.
Spreadsheet Automation 101: Camel Case
About this Tutorial
Video Transcript
It is a way to allow one function to be one word, get active spreadsheet with no spaces, but we can actually read it so the get the G in get The very first word is lowercase, and then act of the second word is capital A active. Spreadsheet is capital S. This camel case allows us to read our functions much better, and it also allows a computer to know what it is.
If we do something like this, get sheet by name, dot get range. We're gonna do one, one, we're, we're gonna get into this really soon. This is a one get value, and then we want to just return this value.
We'll call it the one. So we'll use this variable as we said here, return. We don't need any variables up here. We'll call this one or the one we'll be writing this out and I'll be going much deeper into this later. What this function is is just saying it's called the one with the variable, the one, and we return the one.
The one is the first value in a one. So we put a value in there. Goals, the one, let's see that it works as is. It does. So what happens is if I don't have a capital bee here, which is a tiny, tiny little mistake I'll save it and we'll go back to. Sheet and we get an error. This error, let me see if I can increase that size.
It says type error spreadsheet, app dot get active spreadsheet. GI sheet by name is not a function and it gives us this line three to see so we can use this error usually. Errors are pretty bad, but in our case, it gives us so much information that we can debug our code and I'll be getting more into errors later.
But this one errors really common when you not, when you don't use camel case. So we know get sheet by name is a function. We've used it, we're using it. It comes up in the auto fill. But what happens is it is literally because it is a cap it should be a capital B, not a lowercase B. It should be all lowercase all camel case, not all lowercase.
So we save it again, and this error should turn out to B, not an error. Let's redo it. The one and. No errors. It also gave us, by the way, line three here. This is line three of our app script, and it told us right in the error that the error is in line three. Now when, if it's some type of syntax error or like naming error?
Yes. Usually the error is in exactly the place that the error shows. line three. But I will say now, and just give you a little bit bonus thing here in this chemical case video, that errors sometimes will error out, but it'll actually be in a line or some variable above it. So that error that you're getting, especially if it's some.
naming error will be fine, but if it's some kind of variable error like get snow is undefined, those are usually wherever the variable is, not in the error where the error occurs. So just a little note there, but just make sure you use Camel Case. One big thing is that the, these spreadsheet app, mail app, these large apps that include all of the functions in them are not actually Camel Case.
They are. The first character is capitalized, and you'll see this in pink. You'll know if this is right or wrong, if it's in pink or not. For instance, this is lowercase s it's not in pink, and it is here. Bye bye.
Courses
Spreadsheet Automation 101: Introduction to Pre-course Videos
Breaking Through Errors In Apps Script
Think Like a Programmer: Develop The Mindset of an Apps Script Coder
Tips to Navigating Thousands of Lines of Code In Apps Script
Spreadsheet Automation 101: Functions
Spreadsheet Automation 101: Variables
Spreadsheet Automation 101: Dot Notation
Spreadsheet Automation 101: Camel Case
Spreadsheet Automation 101: Parentheses
Spreadsheet Automation 101 Lesson 1: GetValue - Introduction to SpreadsheetApp
Spreadsheet Automation 101 Lesson 1: Spreadsheet Taxonomy
Spreadsheet Automation 101 Lesson 1: A1 Notation vs Row,Column Syntax
Spreadsheet Automation 101 Lesson 1: getActiveSpreadsheet() vs getActiveSheet()
Spreadsheet Automation 101 Lesson 1: onOpen() Trigger - Custom Menu
This Seems Like Automation
Spreadsheet Automation 101 Lesson 2: Get Values - Introduction
Spreadsheet Automation 101 Lesson 2: Arrays
Spreadsheet Automation 101 Lesson 2: For Loop
Spreadsheet Automation 101 Lesson 2: Bracket Notation
Spreadsheet Automation 101 Lesson 2: Logger.log()
Spreadsheet Automation 101 Lesson 2: If ( ){ } and Checkboxes
Spreadsheet Automation 101 Lesson 2: onEdit() Trigger
Introduction to Spreadsheet Automation 101 Lesson 3
Spreadsheet Automation 101 Lesson 3: MailApp
Spreadsheet Automation 101 Lesson 3: Email Yourself For Loop
Spreadsheet Automation 101 Lesson 3: Send Email Every Week Trigger
Spreadsheet Automation 101 Lesson 3: Email Other People For Loop
Spreadsheet Automation 101 Lesson 4: Access APIs Introduction
Spreadsheet Automation 101 Lesson 4: UrlFetchApp
Spreadsheet Automation 101 Lesson 4: OmdbAPI get ApiKey, get Data in URL
Spreadsheet Automation 101 Lesson 4: OmdbAPI get data in Apps Script
Spreadsheet Automation 101 Lesson 4: JSON (beautifier) and OmdbAPI parameters
Spreadsheet Automation 101 Lesson 4: OmdbAPI Parameter Picker
Automatically Clear Content | Refresh Reuse Recycle Templates
Automate Google Sheets With Zero Experience
Automatically Uncheck A Daily Checklist
Activate A Certain Sheet When Opening a Spreadsheet
Scoping Functions in Apps Script