If you manage a Google Sheet that acts as an inventory tracker, an issue log, or a daily sales ledger, logging in every single morning just to check if anything new was added is incredibly inefficient. A true dashboard should proactively notify you of its status.
You can automate this entirely using Google Apps Script. We can write a script that wakes up at 8:00 AM every morning, scans your spreadsheet, calculates a daily total (like “Total Sales” or “New Issues Logged”), and automatically sends a beautifully formatted summary directly to your Gmail inbox.
Step 1: Access the Script Editor
- Open your Google Sheets document.
- In the top menu bar, click on Extensions.
- Select Apps Script. A new browser tab will open displaying the code editor.
Step 2: Write the Email Script
Delete any default code in the editor (like function myFunction() {}) and paste the following JavaScript code. This specific script assumes you want to sum up a “Daily Revenue” column, but it can be easily adapted to simply count rows.
function sendDailySummary() {
// 1. Connect to the specific sheet
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("SalesData");
// 2. Grab all the data in the sheet
var data = sheet.getDataRange().getValues();
// 3. Variables to hold our summary data
var totalRevenue = 0;
var rowCount = data.length - 1; // Subtract 1 to ignore the header row
// 4. Loop through the data to calculate the summary
// Assuming Revenue is in Column C (Index 2)
for (var i = 1; i < data.length; i++) {
var revenue = parseFloat(data[i][2]);
if (!isNaN(revenue)) {
totalRevenue += revenue;
}
}
// 5. Construct the Email Content
var emailAddress = "[email protected]"; // CHANGE THIS
var subject = "Daily Spreadsheet Summary: " + new Date().toLocaleDateString();
var message = "Good morning,\n\n" +
"Here is your daily summary from the tracker:\n\n" +
"- Total Rows Processed: " + rowCount + "\n" +
"- Total Revenue Logged: $" + totalRevenue.toFixed(2) + "\n\n" +
"Click here to view the sheet: " + SpreadsheetApp.getActiveSpreadsheet().getUrl();
// 6. Send the Email
MailApp.sendEmail(emailAddress, subject, message);
}
Make sure to change “SalesData” to the actual name of your tab, and update the emailAddress variable to your real email.
Click the Save icon (the floppy disk) at the top of the editor.
Step 3: Test the Script
Before automating it, ensure the code actually works.
- At the top of the Apps Script editor, ensure
sendDailySummaryis selected in the dropdown menu. - Click the Run button.
- Google will prompt you to “Review Permissions.” Click it, select your Google Account, click “Advanced,” and click “Go to project (unsafe)” to grant the script permission to send emails on your behalf.
Check your inbox. You should instantly receive an email containing the accurate summary of your spreadsheet.
Step 4: Automate It with a Time-Driven Trigger
Now, we need to tell Google’s servers to run this script automatically every morning, even when your computer is turned off.
- On the far-left sidebar of the Apps Script editor, click the Triggers icon (it looks like a small alarm clock).
- In the bottom right corner, click the blue + Add Trigger button.
- Set “Choose which function to run” to sendDailySummary.
- Set “Select event source” to Time-driven.
- Set “Select type of time based trigger” to Day timer.
- Set “Select time of day” to your preferred time (e.g., 8am to 9am).
- Click Save.
The automation is completely finished. Every morning, Google’s servers will quietly run your code and drop a fresh summary report directly into your inbox.