Besides Historical Tracking Reports, Reporting Snapshots is another feature that we can implement when we want to report data in a deeper and more customized way.
With Reporting Snapshots, you can map tabular or summary reports to a custom object so that you can work on a report's results in the same way as you would work with any other Salesforce object.
When I was first introduced to Reporting Snapshots, they appeared to be magical—at least from my junior developer point of view. I used them to track day-to-day status changes on changing records on our customer business flows.
For Reporting Snapshots to work, we need a custom report where all the required columns will be tracked, a custom object where the tracked data will be loaded and, of course, custom fields, which will receive actual data when the reports are run.
We are doing this because we want to track the case age by status to see how cases are handled in their life cycle (until they are closed) and check how many days each status stays still.
You can create a simple report that shows open cases by using the following details:
- Columns: Case Number, Case Owner, Status, and #Age
- Filter: Status not equal to Closed, Cancelled
This is how it may appear:
Now, create a new custom object with the following shape:
- Object name: Open Case Lifespan
- Custom fields:
- Case Number: Text (20)
- Age: Number (0 decimal places)
- Status: Text
- Case Owner: Text
Remember to set the field-level security for your user (you may run into problems when snapshots are collected if your user doesn't have access to those fields).
To define a new Reporting Snapshot, go to Setup | Feature Settings | Analytics | Reports & Dashboards | Reporting Snapshots, click on the New Reporting Snapshot button, select Running User as your user, select the previously created report, and then select the Open cases lifespan custom object:
Now, click on the Edit button on the Field Mappings section and select the correct mapping. You should see the following output:
Click on the Save button to save your work. Then, click on the New button of the Scheduling Reporting Snapshot section to select a schedule configuration, as follows:
You can even select to be notified when the snapshot is executed.
Now, you are all set—all you have to do is wait until the first run.
After the first run, you can query the Open Case Lifespan object, like you would any object.
We can even report on this object to find out more about it.
We've created a new report on the Open Case Lifespan object with the following configuration details:
- Grouped by Case Owner, Case Number, and Status
- Age column
- Average summary on the Age column
- Bar chart with a status on the y axis, Case Owner for the bar color, and Average Age on the x axis
The previous configuration gives us the following results (this is just an extract that's been divided into two different images and merged into one to show both owners):
We also receive the following chart:
This seems to clearly state that Enrico Murru has the best average age case on a status by status grouping.
This may not be the best use case for using snapshots, but it may be a good starting point for your next report.