Members-only tutorial
Watch the video and get the practice sheet with membership.
About this tutorial
Annotated transcript
20 formulas linked inline Click any highlighted terms to learn more.<div> Hi. In this video as we as always, we'll go into app script and I wanted to mention and stress Camel case. I wanted to mention how important Camel case is to our writing of functions . How many times will get into errors and it'll be because of Camel case. So, Again, camel case is this capitalization of words that are put together.<br><br>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. Getting Started Coding in Apps Script Title Case How to Capitalize Names Automatically in Google Sheets
This camel case allows us to read our functions much better, and it also allows a computer to know what it is.<br><br>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.<br><br>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. Getting Started Coding in Apps Script Share 1 Cell to API
What this function is is just saying it's called the one with the variable, the one, and we return the one.<br><br>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.<br><br>It says type error spreadsheet , app dot get active spreadsheet . Getting Started Coding in Apps Script Share 1 Cell to API
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.<br><br>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. Most Common Errors and How To Handle Them in Google Sheets How to Retype Header Automatically
It should be all lowercase all camel case, not all lowercase.<br><br>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 ?<br><br>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.<br><br>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.<br><br>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.</div> Getting Started Coding in Apps Script Capitalize First Letter