Taking a slight detour off of the data analysis/spreadsheet path and getting into the world of productivity hacks with this episode. A productivity hack can mean different things, and in this case it’s a hack to improve your workflow at, you guessed it, work. This hack gives you the ability to create a Google Calendar event by sending yourself an e-mail in Gmail on your phone. The goal of this productivity hack is this: avoid switching contexts (apps) to schedule a calendar event. I get into the problem and solution below, but if you want to just start using the Google Apps Script go to this repo. Watch a quick tutorial on how this script works below:
Your calendar is what you actually do
Like many of you out there, I live by my Google Calendar (for better or worse). The app just gets one thing done really well and integrates with all your other apps. I have my personal Google Calendar overlaid on my work calendar so I can see personal appointments and such. Over the years, I’ve started using my calendar for more than just events and appointments. It’s almost become a to-do list, reminder tool, and calendar all bundled in one.
For instance, I’ll typically have all-day events scheduled to act as a reminder for when I need to pay a bill. I may have an event called “follow up with so-and-so” just to remind me to send an email to that person. This starts to getting into my Gmail workflow of snoozing emails to remind myself to follow up with someone. But “seeing” that event on my calendar gives me more visibility into what I actually need to do a given day or week whereas the snoozed email just pops up when it’s scheduled to.
If you’re interested in this gentle dance between your calendar, email, and to-do list, check out this Coda template from Des Traynor I worked on a few years ago. This is the money Tweet which shows why our calendars dominate our lives:
Boiling the frog
This productivity hack solves a problem I didn’t really know existed until I reflected on how much time I spend using the Google Calendar app on my phone (I have an Android). When I’m going through emails on the Gmail app, I’ll inevitably need to schedule an event or reminder to do something in the future. This is how some emails may potentially turn into a Google Calendar event:
- Get an email from a friend to get lunch -> Create a calendar event with something like “Hold for lunch with X”
- Promotional email from Doordash to get 15% only if you use by X date -> Calendar event on X date that says “use Doordash promo”
- Email comes on the weekend showing random fees on my Internet bill -> Schedule event on Monday that says “call Spectrum to get rid of fee”
It’s not a perfect system, but it works for me. The issue is that I’m constantly closing the Gmail app and opening the Google Calendar app to add these events to my calendar.
The Google Calendar app is easy to use and I’ve been content with doing this Gmail <-> Google Calendar dance over the years. A few weeks ago I realized how much I’ve been switching back and forth between these apps and how much time I waste context switching. Why do I need to leave Gmail to create these quick Google Calendar events? Once I made this realization, I cringe a little bit every time I have to open the Google Calendar app just to schedule a reminder event to call customer service. Eventually, the proverbial frog couldn’t stand the heat anymore, so I jumped out as things boiled over.
Save the clicks (or taps)
The real problem (as with many consumer apps) is the number of clicks and taps you’re required to make on your phone when scheduling an event on Google Calendar. Let’s assume you are in the Gmail app on Android and need to create a Google Calendar event after you’ve just seen an email requiring you to schedule something. Some other requirements:
- You need to invite someone to the event
- The event needs to be at a specific time
- The event needs a description
Let’s compare the clicks/taps required to make this event using the Google Calendar app. Typing characters for the event are not counted.
Using the Google Calendar app
Just to get to this screen requires 2 clicks (one to get out of Gmail and another to get to the Google Calendar app):
Once you’re in the app, you need to click on the big plus sign in the bottom-right to get to the create event screen (1 click):
By default, the cursor shows up in the “Add title” field so you don’t actually need to click into the field to start typing the event title. Saving a tap here. But if I want to change the date of the event, I need to tap on the start date (1 click):
Now depending on how far away in the future your event is, you may need to click a few more times to access future months. Let’s just say the event is later in September so you tap on that date to set it and then tap “OK” (2 clicks). Next is the time. You tap on the event time to bring up this time picker (1 click):
I’ve gotten use to setting times on Android but it’s not the most intuitive experience. To set the time to 9:30AM, it would require hitting the “9,” then hitting “30,” and then the “AM” modifier at the top, then “OK” (4 clicks). To invite others and add an event description:
- Add attendee (3 clicks): Click on the “Add people” field, type in the person’s email address and click on the autofilled name, then click “Done”
- Add event description (1 click): Click on the event description field
Of course, to save the event after you’ve filled out all the fields, you click on the big “Save” button in the top-right (1 click).
In total, it requires a minimum of 15 clicks to create a Google Calendar event on the Android app (not to mention the context switching).
Using Gmail to create a Google Calendar event
Just to be clear, this solution applies only to sending emails from Gmail on a mobile device. On desktop, there’s already a solution for creating events from Gmail. I’ve never used this feature on desktop since Google automatically puts the subject of the email as the event title. Sometimes the subject line is super long and it wouldn’t make sense for it to be the event title anyway (I like to keep event titles short and succinct).
Using this script, you create an email that looks like this to create a Google Calendar event:
The number of clicks to get a Google Calendar event scheduled using this method (again, ignoring typing characters):
- Create Gmail draft: 1 click
- Set the recipient of the email: 1 click
- Write the event title, date, and time in the subject line: 1 click
- Write attendees and event description: 1 click
- Save the event (send email): 1 click
This method requires 5 clicks.
One could argue that typing out the date and time is more cumbersome than tapping the date/time using the Android time/date picker interface. You also have to know the full email address of your attendees since the body of the email is freeform text (thus no autofilling of email addresses).
Nevertheless, I feel more comfortable typing out the date/time than using the awkward date/time picker. The best part of this solution is that I stay within the context of the Gmail app. Switching from Gmail to Google Calendar isn’t context switching from what you’ve seen in the media and on blogs.
Creating the solution in Google Apps Script
Creating a solution to save time by not having to open the Google Calendar app on your phone is pretty inconsequential in the grand scheme of things. We’re talking about 5 taps versus 15 taps to create a Google Calendar event. Doesn’t feel like that much time saved, but it’s so nice to stay within Gmail where the triggers for creating calendar events exist in the first place.
Since I use Gmail and Google Calendar for both work and personal life, I figured Google Apps Script would be the glue to hold everything together. I have posted about Google Apps Script I created in the past to help automate various workflows. The main reason I continue to use it is because it’s free. Unless you are running a script many times a day on a large amount of data, you’ll never hit the quotas before you need to pay a penny to Google (the cost of having all your data with Google is a story for another time).
At a high-level, these are the features I wanted in this Google Apps Script:
- Send myself emails with the details of a Google Calendar event
- Event title, date, and time would be in the subject line
- Other event data (attendees, event description, location, etc.) would be handled in the body of the email
The script requires you to do some setup in Gmail. Namely, creating a filter where emails to yourself automatically get labeled with something like “EventsFromEmail.” The filter looks for a specific email to yourself that includes the “+” character. For instance, if your email is “email@example.com”, the recipient email address might be “firstname.lastname@example.org.”
Once this filter is setup, the script does the following:
- Go through all the emails in the “EventsFromEmail” label
- Find the ones that are unread
- Create a Google Calendar event from the details in the unread emails
- Mark these unread emails as read after the event is created
Automating the script with triggers
Going through all the emails in a specific label and creating events from the unread emails feels inefficient. The real solution I was hoping for was having the script run right after you send yourself an email. After doing a little research, turns out there are no Google Apps Script triggers that would kick kick off a script when an email lands in your inbox. There is a solution involving webhooks and Google Cloud’s Pub/Sub feature, but this would require you to dip your toes into setting up a Google Cloud account, billing, etc. which is annoying. Google Apps Script runs on Google Cloud anyway, but the nice thing about Apps Script is you don’t have to deal with all the overhead of setting up Google Cloud.
Since we can’t “watch” for emails in Gmail, we turn to the time-driven triggers. This means the script runs every 5 minutes or whatever interval you think is appropriate for your use case. Again, I don’t think this is the most elegant solution because:
- Requires the script to constantly check for new emails in your “EventsFromEmail” label
- Wastes compute power
I believe a time-driven trigger is how most standalone Google Apps Scripts are run. The no-code interface for setting up the cron job is really easy to understand:
Other Podcasts & Blog Posts
No other podcasts this episode!