Members-only tutorial
Watch the video and get the practice sheet with membership.
About this tutorial
Annotated transcript
17 formulas linked inline Click any highlighted terms to learn more.<div>0:00 Just like in the last video where I talked about Camel case, in this video parenthesis we're talking about one very, very specific thing, but it's so, so important to detail.<br>0:11 So again, we'll go up to ca extensions app script . We have our app script that we've been working on here and we will work on in a video or two.<br>0:20 But I wanna show you, I just want to point out all of the parenthesis in the function name. We always have the name of the function , and then two parenthesis, open parenthesis and closed parenthesis.<br>0:30 These are very, very important. Getting Started Coding in Apps Script CLUTTERED CODE
They're almost like a, a parent warmly hugging all of their children. All of these little variables here, like you can have 1, 2, 3, not toe, but two, three.<br>0:43 You can have ver many variables inside of here. And these parentheses are like a parent. They, they hug their children.<br>0:50 They're very, very, very important.
You must have parentheses here and you must have parentheses are on function names after function names, except almost everything gets a parenthesis except the first one when we're talking about like spreadsheet app, mail app will get to, there's a few other apps that are included in app script that allow us to use functions within them.<br>1:14 These do not have parentheses. So if we have something like this, let's see the one, let's go back and make sure this does work right?<br>1:24 But if we use a spreadsheet app and we put parentheses here, let's see if that actually works. Getting Started Coding in Apps Script VIBE CODE GOOGLE SHEETS
And if we, let's see if we get an error , we do get an error .<br>1:32 And what that error is, is spreadsheet app is not a function line three. And this is telling us something that we might not necessarily groc right away.<br>1:41 Okay? We can look at line through three and we're like, what is wrong with this? Right? There's spreadsheet app, there's GI active spreadsheet , I got parenthesis on everything.<br>1:49 And the issue is you got parenthesis on everything. The first one spreadsheet app does not have parenthesis. Getting Started Coding in Apps Script What is a Spreadsheet? Anatomy of a Spreadsheet
It's not a function of spreadsheet app, it is spreadsheet app itself.<br>2:00 Maybe something like this. The one, if we take off parentheses here, we'll have maybe another error . Let's see if it changes that error .<br>2:13 Nope, actually we don't get an error there. So we don't need, oh wait, we haven't saved it. Okay, <laugh>, we haven't saved it at all.<br>2:19 In fact, we get the error in app script itself. It's a syntax error, unexpected token. Getting Started Coding in Apps Script VIBE CODE GOOGLE SHEETS
It has a curly bracket line one right here in the file code ees.<br>2:30 So we look at line one and we're like, well, that curly bracket is correct. Every single function should have a curly bracket.<br>2:36 And notice here I mentioned earlier that sometimes where the error says it is an error , it's actually just before that.<br>2:42 And in fact, this is the error , right? The error is not the curly bracket itself, it's the fact that we don't have parentheses.<br>2:49 So we add parentheses, open parenthesis, close parentheses, and now we save. And now we're able to save, right?
We don't get an error inside of app script .<br>2:58 We don't get an error here in our Google sheet. We now have a functional function with parenthesis. I wanted to point out, well, we're here though.<br>3:09 That parent inside the parenthesis sometimes does what there is sometimes matters. So if we have like a variable range here and we're trying to get like a one and we are doing get range , range , cuz we can use a variable for that range , we're gonna get an error if we run it from inside of app script.<br>3:33 Let's see, we'll have to review our permissions. We'll do this again later. Getting Started Coding in Apps Script Password Protect Google Sheets
I'm not gonna walk through this right now.<br>3:39 Just get through this. We could probably get an error . Yeah, argument cannot be null. A one notation . So what this is telling us is that actually right here, this line range and range , there's nothing there.<br>3:56 We don't, it's a variable. A variable must be filled with something.
So this doesn't mean that our function is wrong, it means that we're running it from the wrong place.<br>4:06 So if we put inside the parenthesis here, the one in quotes, a one that gives us the actual value of the variable.<br>4:16 So now the range , this range is a one and this range is a one. So we get through this, this argument in the, the error by actually adding something that is defined, which is a one, but we do it inside of the parenthesis here.<br>4:30 Again, we're gonna get deeper into this and how these variables work.
And you'll see this multiple times over and over and over again with variables inside the parenthesis without variables inside the parenthesis.<br>4:39 Sometimes we want 'em, sometimes we don't. Sometimes it's all sorts of things. So check out, like if we use sheet one here and we don't use quotes, it looks pink.<br>4:50 Not that like brown. So that is going to be a problem. And let's see what we got here. How To Reference Another Sheet in Conditional Formatting
And we got an error .<br>4:58 And it says error sheet one is not defined perfect because we need inside these parentheses, we need it in quotes.<br>5:04 Sometimes we need in quotes, sometimes variables don't have quotes. But if we have actually like an actual string that we want, we put that in quotes here just like we did here in with a one in quotes.<br>5:16 All right, thanks for watching now on two more. I'm so glad you got through all these videos. Bite.</div>