Category Archives: Google Apps

Google Apps Script to monitor an email box and send notifications

googlemail-128

Here’s the scenario: you have a second gmail account that gets email infrequently, but you need to monitor it.  For whatever reason (company policy, in my case), you can’t forward the email to your main account.

I discovered that I could log into the second Google account and attach a Google Apps Script to a spreadsheet.  The script monitors the gmail account for unread threads.  If it finds any, it sends a message to my main account.  The script has a time-driven trigger that can be set to run as frequently or infrequently as desired.

To use the script, get the spreadsheet template from my template page.  Open the spreadsheet and edit the cells that contain the email message parameters.  Then go to Tools – Script editor.  Choose Resources – Current project’s triggers.  Add a time-driven trigger that runs the script as often as you’d like.

Email Notifier trigger

Google Apps Script to find duplicates in a Google spreadsheet

Sometimes you want to find duplicate rows in a Google spreadsheet, but don’t want to examine every column — maybe you want to exclude a timestamp or other columns.

This Google Apps Script takes a list of columns that you care about.  Then it temporarily copies those columns to a new sheet, looks for duplicates, highlights the duplicate rows in red on the main sheet, and removes the temporary sheet.

The script is attached to this Google Spreadsheet Template. Open the script with Tools – Script Editor, and copy the script to the script editor of your own spreadsheet. Then edit the line that defines the important columns. After you re-open your spreadsheet, the “My Scripts” menu will show up. The first time you run the script, it will bring up the permissions dialog. You’ll need to run it again to make it work.

Here’s a video of it in action: