One of the least exciting parts of my job as a consultant is logging my time. Working for a small consulting firm, we have the flexibility to choose the tools that work best for us which is great because I have found a perfect way to automate my life using Toggl, Zapier and Salesforce.
This idea is thanks to John De Santiago, a fellow Salesforce MVP and colleague of mine at ShellBlack.com. John is also the co-host of the Good Day, Sir! podcast. On episode 97, John mentioned automated time logging using Zapier. Intrigued, I called him up and he shared his setup with me and it works like a champ.
In My Favorite Productivity Tools Revealed, I noted that I look for tools that integrate with one another which is why I’ve moved from Hours to Toggl for time tracking. This move has enabled me to create this automatic workflow integration, saving me 10-15 minutes a day. Over the course of a year, that’s a full 40 hours of savings!
The Use Case
As I mentioned, Toggl is used to track my time throughout the day. Salesforce is our system of record and generates all of our invoices, so, at the end of the day, I would log into Salesforce and manually enter my time from Toggl. Not an awful process, but after a full day of work, it’s the last thing I want to be doing!
The Solution: Integrated Automation
Zapier is a point and click integration tool. Very similar to IFTTT and Workato, it allows you to integrate any two apps to perform specific actions based on a trigger event. They call these Zaps! I chose Zapier over IFTTT or Workato because Zapier is currently the only one to support Toggl.
The setup in Zapier is pretty easy and works similar to Process Builder. My Zap has five components:
- A trigger action (new time entry in Toggl)
- Data Transformation (get the hours rounded to the correct quarter hour)
- Search Salesforce for the related project record
- Continue if logic (does the project exist?)
- Create action in Salesforce (create the time entry)
Here’s how each of the steps breaks down (with screenshots, of course)!
Step 1: Trigger Action
Toggl is the trigger platform. Based on the action, the Zap kicks off. This of this as the entry criteria for the workflow rule.
Step 2: Format the Hours Duration
Toggl performs rounding of time but only in reporting. Salesforce however, only accepts rounded hour values in the form of 0.25, 0.5, 0.75 and 1. So, in order for the integration to work, I need to convert the duration in Toggl to the appropriate format. Using the Numbers step, I’ll use a spreadsheet style formula to convert the value.
This step works much like Salesforce’s own Flow. I’m essentially creating a variable which we’ll use in a later step. The above calculation will round up or down to the nearest quarter hour based on the Duration Hours field provided through Toggl.
Step 3: Search Salesforce for Project
The next step in the process is going to query Salesforce to find a related project. Since I cannot personalize Toggl with custom fields, and I’m not an Admin in my Salesforce org, I can’t create cross reference fields using Salesforce and Toggl project ID’s so, this step is going to search Toggl’s project name in Salesforce to validate that a project exists.
The key with this step is to ensure that the project name in Toggl matches exactly to Salesforce. In my case, project names are pretty unique so this isn’t an issue. However, I’ll discuss what happens if the project name is changed, or can’t be found in a bit.
I’m suring the Project custom object in my Salesforce org, and I’m looking specifically for the Project Name to match. Using the fields provided by Toggl, I’ll enter the search value as Toggl’s Project Name.
Step 4: Only Continue If
Step three performs a single function: search Salesforce. It does not provide any sort of result on the search. That’s what Step 4 is doing – validate that a Project was found during the search.
If a Salesforce ID exists, continue to the next and final step. If it does not, stop the process.
Step 5: Create the Time Entry in Salesforce
If all of the following steps executed as expected, the last and final step is to create the time entry in Salesforce. This is a related object to the project called Hours. This step is basically a mapping exercise using Toggl’s fields to create the record.
There are a few things to point out on this step. The Hours Logged field in Salesforce has the calculated value we created in Step 2 of this Zap. I’ve also referenced the Project ID found in Step 3. Some other values are defaulted through this step, and I’m mapping some Toggl fields here as well (but couldn’t get the full page in a single screenshot).
I’ve been using this solution for a week, and I can tell you, it works really well! When a project timer is stopped in Toggl, Zapier will process that time and automatically log it against the correct project in Salesforce.
Now, instead of 10-15 minutes logging my time for the day, I spend about 30 seconds to a minute auditing the hours in Salesforce. Generate the report in Salesforce, generate the report in Toggl, ensure the hours match, and move on.
I have had a few instances when Toggl has created a time entry in Salesforce for the next day, but that’s the only issue I’ve run across yet.
Salesforce is a Premium application with Zapier which requires a paid plan to execute any Salesforce related Zaps. Toggl has a free plan which would be sufficient. I’ve paid for a Pro plan which enables time rounding in reports, but a Pro plan isn’t necessary.
Are you using Zapier, Workato, or IFTTT to automate processes in your professional life? Share them below – I would love to automate even more!