Simple Weight Tracker Automatic Add Row
Learn how to create a simple weight tracker in Google Sheets that automatically adds a new row for daily entries, making it easier to track your progress over time.
So a common thing to do in weight tracking is to have our sort of header and rows here and then go down from the very first date to the very latest date. But I've reversed it. This is actually much simpler. So what I'm doing here is this is reverse chronological order from the when I started here up. And so all we have to do, and this is just to make it super simple to enter my weight here for a weight tracker, we're going to add an automatic row. So if I enter here 198.2, yay. And I have to enter today. Weight Loss Tracker Template Weight Tracker - Reverse Chronological Order Ultimate Weight Tracker
But I don't want to do that. I want this row and this cell to be there ready for me in the morning whenever I have timed when I'm going to set my weight in here. So let's go up to extensions appscript and we're going to need to do two things. We're going to need a new row and we're going to need a function new date. The new date function very simple utilities format date new date capitaliz with parenthesis time zone is going to be whatever the time zone of the spreadsheet is. So we're going to do spreadsheet app get active get spreadsheet time zone. Let's add this to a new line. And then the format. The format is important because it should be the How To Change Date Format Automatically How To Create a Stop Watch in Google Sheets Get new Date
format that you want and that you've already formatted this cell and this column with. So in our case, it's month/dyear year. And so every time we use this new date here as a function , we're going to get this result here. we actually have to return that. So we'll return the formatted date anytime that we use new date. Now new row. Okay, we are on a sheet one. Let's call this weight or track actually. And now we go to spreadsheet app.getactive spreadsheet . Get sheet by name. And then How To Change Date Format Automatically Google Sheets Interface Changes Get new Date
we're going to use track here. Let's make sure it's Oh, it's not capitalized. Check. Then we're going to insert row . Now, here's a little trickyness that we don't have any trick here. So, it's not tricky for us, but usually it's tricky if we have a header . Usually, it's tricky if we have something going on. We're going to say insert row before one. Now, what this is going to do is go to the very top row and insert one. So, what we need to do is time this new row before We want to enter our our thing, but already the date. So, this is going to the timing is going to be a little tricky, but we also want the new date. How to Insert Multiple Rows in Google Sheets (Easy to Hard) How To Create a Stop Watch in Google Sheets
So, we're going to say this exact thing. Spreadsheet active active spreadsheet track dot get range and in one row one column two set value and it's going to be new date whatever is in the function of new date. Now all of this can be simplified as well. variable track equals this and then we go track.insert and we go track. So it's all going to the spreadsheet track. But we just make it a little simpler here. Save this. Now let's try it. Um let's actually delete this first row now. And all we're going to do is hit run. We'll have to Track Every Edit (Almost) Track Anything! In a Google Sheet
authorize the first time we do it. And it's done. So, we haven't had any errors. If we have any errors, it'll show up here. Let's rename this. Do a simple tracker. So, now that we know that our addition, our our automation is going to work. We need to make it for a specific time. So, over in our app script , go over to triggers on the left side. On the bottom right, go to add trigger . Choose which function to run, which is going to be new row, not new date. Then event source is going to be changed to time driven. Our hour timer is going to be changed to daytimer. Which time of day? Now this is going to be important. It needs to be done on the same day that we're doing it, but before we actually enter the the um wait, Different Kinds of Automation What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users
right, let's say 4 to 5 a.m. and save. Now, we know it's going to run at some point between 4 and 5 a.m. our time. We know it because we've already hit run and it works. We're going to hit allow. We just need to authorize one more time. And we can close this. And we can also close our sheet and just save our sheet and come access it when we want to. We want to enter our what D 8.5. Let's say we regressed a little bit. It's okay. Daytoday. Now, if we want to delete that automation for some reason, maybe we've skipped a few days and we're not going to come back to this. Go up to Automate Move Blank Rows
extensions appscript. Over on the left side, click triggers and over on the right side of this trigger new row. There'll be three dots. Click delete trigger and delete forever. Or you could delete that pencil icon and you can edit the time if you want to. there. That's how you enter a simple weight tracker that's going to automatically add a row at the top. You're watching better sheets here on YouTube. You have two options here for your next video. Before you go, comment down below if you have any question whatsoever and I'll make future videos from those questions. But for right here, right now, one of these videos could be your next Google Sheet. Now Do It Every Damn Day - Learn to Code in Google Sheets Part 5 What Can You Automate in Google Sheets? Every single trigger available to Google Sheet users Built a Cookie Clicker Clone in Google Sheets Easiest Weight Tracker Ever - Append