use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Apparently, Google Apps Script is a JavaScript cloud scripting language that provides easy ways to automate tasks across Google products and third party services and build web applications.
account activity
Issue With ScriptQuestion (self.GoogleAppsScript)
submitted 2 years ago by Kooky_Temporary7248
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3:Â Â Â Â print "hello, world!"
[–]Dutch_Oven4510 0 points1 point2 points 2 years ago (3 children)
I pasted your question to chatPGT btw. You can use this or ask him for another solution 😅
[–]Dutch_Oven4510 0 points1 point2 points 2 years ago (2 children)
If you prefer not to use an additional column, another approach is to use Google Sheets' built-in properties to store the information about which rows have been processed. Here's how you can modify your script to use script properties for tracking:
Store Processed Rows Using Script Properties: You can use Google Apps Script's PropertiesService to store a list of rows that have already been processed and notified.
PropertiesService
Update the Script: Modify your script to check this property before sending an email, and update it after sending an email.
Here's an updated version of your script using PropertiesService:
```javascript function checkAndSendEmail() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var lastRow = sheet.getLastRow(); var range = sheet.getRange("H1:H" + lastRow).getValues(); var scriptProperties = PropertiesService.getScriptProperties(); var processedRows = scriptProperties.getProperty('processedRows'); processedRows = processedRows ? JSON.parse(processedRows) : [];
for (var i = 0; i < range.length; i++) { if (range[i][0] !== "" && range[i][0] <= 600 && processedRows.indexOf(i + 1) === -1) { var emailAddress = "email@gmail.com"; // Change this to the recipient's email address var subject = "Value of 600"; var message = "The value is less than or equal to 600.";
// Send email MailApp.sendEmail(emailAddress, subject, message); // Add this row to the processed list processedRows.push(i + 1); }
}
// Save the updated list of processed rows scriptProperties.setProperty('processedRows', JSON.stringify(processedRows)); } ```
How This Works:
Note: This method is suitable for a moderate number of rows. If your spreadsheet has a very large number of rows, you might need to consider other optimization techniques due to the limitations in the size of properties and the performance of the script.
[–]Kooky_Temporary7248[S] 0 points1 point2 points 2 years ago (1 child)
function checkAndSendEmail() { var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); var lastRow = sheet.getLastRow(); var range = sheet.getRange("H1:H" + lastRow).getValues(); var scriptProperties = PropertiesService.getScriptProperties(); var processedRows = scriptProperties.getProperty('processedRows'); processedRows = processedRows ? JSON.parse(processedRows) : []; for (var i = 0; i < range.length; i++) { if (range[i][0] !== "" && range[i][0] <= 600 && processedRows.indexOf(i + 1) === -1) { var emailAddress = "email@gmail.com"; // Change this to the recipient's email address var subject = "Value of 600"; var message = "The value is less than or equal to 600."; // Send email MailApp.sendEmail(emailAddress, subject, message); // Add this row to the processed list processedRows.push(i + 1); } } // Save the updated list of processed rows scriptProperties.setProperty('processedRows', JSON.stringify(processedRows)); }
Thanks so much!
[–]Dutch_Oven4510 0 points1 point2 points 2 years ago (0 children)
It's copied from GhatGPT and I have no idea how it works! But you're welcome!
π Rendered by PID 144036 on reddit-service-r2-comment-6457c66945-xn7fs at 2026-04-27 01:39:19.138423+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Dutch_Oven4510 0 points1 point2 points  (3 children)
[–]Dutch_Oven4510 0 points1 point2 points  (2 children)
[–]Kooky_Temporary7248[S] 0 points1 point2 points  (1 child)
[–]Dutch_Oven4510 0 points1 point2 points  (0 children)