Salesforce is a fantastic tool with mountains of history tracking, trend tracking, and reporting at its disposal. Still, I once encountered the challenge of tracking what people were doing specifically across multiple objects. Productivity Log tracking is something I back of a dead project. The debugging and transaction tools were pivoted to use for this. Even though the following scenario is based around customer service, you can do this in any department that works on updating and creating records.
You have people working in your company and want to see when they are doing what they are doing. You want to push a positive output from those who lead. It will also report on the most active hours during the business. All this above will help you get more bang for your buck from your employees.
Scenario
Take a scenario of your customer service operative. They do a range of tasks, so update cases, close cases, make shipping requests, take calls, and book work for this. Then it hits you want to have the information stored across 3 or 4 objects into one report. It would be nice to have this all in one place in a report. I know there may be a case for using tasks, but tasks created for other things have a low field limit.
Solution
So what we are going to do in this set of tutorials is create a system called a productivity log. Create a reusable Subflow (This Subflow is basic but helps keep outputs uniform). Create a couple of trigger events and a report and dashboard off the back of the data.
Initial Setup
Productivity Log Object Creation
Productivity log object is only used as a logging object and won’t require any automation. We will build trigger points that send through variables and get created on the record. So call it Productivity Log use the auto number option for the name PL-{0000} we will capture who triggered it when they triggered it and what they triggered it for. With a link to the record that triggered it. We will be using the hour to track productivity during certain hours and will be able to analyze where work drops off.
You could build this on tasks, but I have a hang-up on this as there are so few custom fields on it and many processes ended up using them. We need to create the fields below the formulas for the formula fields below the list.
- Name – AutoNumber
- Department – Formula (Pulled from the owner user.department)
- Event Type – Picklist(What it is for Closed Case, Closed Won, Upgrade, etc)
- Record Type – Picklist(Object name it is triggered from Opportunities, Cases, Accounts, etc)
- Hour – Formula
- Event Id – Text Field
- Event Link – Formula
Hour Formula
HOUR(TIMEVALUE(CreatedDate))
Event Link Formula
"https://[YOURDOMAIN].lightning.force.com/" + Event_ID__c
Productivity Log Subflow
For the Subflow, we need to create an auto-launched flow called a productivity log. This will be called a Subflow by record-triggered flows. I want it to work on being able to be called from any flow on any object, so it makes sense not to have to create the element. Doing the previously mentioned saves time when you want to update it further down the time following the design principle KISS (Keep it simple, stupid) and DRY (Don’t repeat yourself). I have previously covered Subflows here.
Variables
Create three text variables for RecordId, EventType, and RecordType they need to be able to take input from outside the flow. You won’t need to default values for any of these, but these are what will be pulled through from each flow that triggers this.
Create Record Element
Add a create record of the productivity log and set the individual values of Event Type as EventType, Record Type as RecordType, and Event Id as RecordId. Once you have done this you can save this flow as Productivity Log and activate it.
Trigger Point Flow Example
For this, we will need a record triggered flow that calls in Productivity Log you will need to set the RecordId as {!Record.Id} and the Event Type as the event you want to track and finally the object you want to track. In this example, we will create one for Case Closed so add Case Closed to the Event Type picklist and Case to the Record Type picklist.
Calling Productivity Log subflow
The only element you need to create in this is a Subflow select Productivity Log from the lookup field in actions and map the values as displayed below. Note to this it is important you have the picklist values set and the text types you pass across as exact matched.
Once have done the flow and activate it. Close a couple of cases and check they have created productivity logs. If they don’t you will need to check the debug screen to see where the issue occurs. This will most commonly be the EventType or RecordType are not the same values you have added in the picklists.
Build the Report
Create a new report with a productivity log. First, you need to include the fields of Owner, event type, event link, record type, and hour.
Now we need to set the filter to be Created date this week using the relative option. Group by Owner then group by the hour field this will allow you to create a chart where you can see the record count during each hour for each owner. Add the chart option.
Create a new dashboard add a component and select the report you have just created. Then click the option to use the chart from the report. Resize the dashboard component and save. After you have done all that you should get a dashboard that looks like the following.
Next Steps
Now you have built this tool you will be able to use it over and over again across departments and objects. This is all because you are reporting from one object the productivity logs. You can deal have Case Closed, and Closed Won in the same chart if your company works that way. What to do is think of what you want to track and add these to the picklists then build or edit flows that trigger off this automation. Honestly, this tool will b a game changer for you in analyzing productivity and staff output. In the meantime, if you check out my other tutorials here any questions or feedback are welcome.