Build a Case Converter From Scratch

About this Tutorial

Create a little web app, or a tool inside of Google Sheets that can take any text input and give us the correct case we want. It can do Title Case or Sentence Case. It can do UPPER and lower case as well.

I added a little apps script to it that will check only one of the options. Check out the Radio Button Apps Script in another video.

Video Transcript

0:00 Alright, in this video we're going to create a case converter because I realized that sometimes we have some kind of sentence or title, and we want to do different cases with it.
0:11 So we are gonna create a case converter, and I wanna show you this because I think it'll be fun. We're gonna have some, we're gonna sort of create a little web app sort of.
0:20 Things. So we're gonna do this from scratch. I'm gonna delete all of these columns and rows, because we don't need them.
0:29 We just need sort of a few things. We want some area to present some words, some sentence. We're gonna hide these grid lines.
0:39 We're going to, increase this a little bit, and we're gonna say right here, let's this is where we're gonna enter our information.
0:49 But we actually want to do it across two columns, I think. Well, we'll see how this goes. We're gonna make this one smaller and this one bigger, and we're gonna introduce, insert checkboxes here.
1:05 And we're gonna say here, uppercase actually, no title case, uppercase, we'll actually, case and lowercase. So we have three options here.
1:18 We're gonna be able to write in our title we're gonna write in, write, something, here. Right now, this is title case.
1:30 And basically, once we click on this button, or these checkboxes, we'll be able to, change this. We're gonna have our output somewhere here as well.
1:39 Well, maybe, let's maybe, we have it right here. Insert a row below. And maybe we'll have our output here. We'll have our selection.
1:52 Maybe we put our selection one more down. Let's give it one more space. We'll have some output here. Okay, so how do we do this?
2:03 How do we get this to actually do what we want it to do? Well, we can do equals tight. Actually, it's gonna be proper.
2:11 In our case, in Google Sheets, it's proper. And we can do something like this. Write something here and write something here.
2:19 And there we go. See, this is now in the title case, let's make all of this a bit bigger. And we don't want Ariel.
2:29 We want something like Carla. Yeah, that's nice. Even bigger. Because we want to see this. We want this to be larger.
2:38 There we go. And let's make it centered to make it a little prettier. Right? Write something here and we get our response here.
2:46 Hmm. What else can we do? Well, we need to be able to click these buttons and get that title case, right?
2:56 Okay. So the easiest thing to do here is use the if, if be, seven or be eight. If that's true, then we're going to use proper.
3:10 If it's false, we're going to do another if. We can do nested ifs here, B9. And if that's true, we're going to do upper.
3:23 B4 and then if it's false, then it's probably going to be if B10. It's going to be either true or false, and we're going to if that's true, we're going to do lower.
3:39 B4 there we go. And all this we now have all of these are false, so we can actually put at the end of these, we need to put just a comma I think and we get oh if I think you need to add this comma there and now it'll be blank.
4:01 Okay, maybe we want to put a message here select one case below and that tells us okay, select this. Oh, we have our title case.
4:15 If we select the upper case there, if we select lowercase, it'll be lowercase. If we have two, what happens if we have two?
4:21 These are just checkboxes. They're independent. And then of each other, we could sort of write a little app script to fix that.
4:29 And I'm going to go over to this tutorial here where I create a radio button, I'm going to grab this app script.
4:35 Cool. So we got that from create a radio button. And we have now a button. The checkbox that if we click another checkbox like this, we have B eight already selected.
4:49 And if we check B nine, it will set all of them to false. And then the one that we clicked will set it to true.
4:55 So we can only have one click at any particular time. So you can see that over here in the app script, but that's another video.
5:03 I just wanted to introduce this here and show that we can create this sort of cool case converter with title case, uppercase and lowercase here select that and now we have our output right here.
5:17 You can say uppercase if we want title case. And if you're watching this and you remember, you can get the sheet down below.
5:25 Bye.