top of page
  • Michael Kolodner

Dynamic Gauge: The First “Dynamic” Feature I’m Using

Salesforce has come out with several features recently with “dynamic” in their names, including Dynamic Forms and Dynamic Actions. It’s clear the “dynamic feature” bandwagon is where a lot of future development effort is directed. But I’ll admit: I haven’t used them.

I’ve followed the development of Dynamic Forms, but for the moment I’m still sticking with the “Related Record Hack.” And Dynamic Actions looks interesting, but I just haven’t taken the time to delve into it because I haven’t had a compelling need. Mostly, I’ve looked at those Lightning page advancements and thought, “they’re adding so many layers of [possible] complexity. How can admins ever find the time to sort through it all?”


But Dynamic Gauge Charts actually caught my eye because they solve a problem I’ve run up against in my work. (Classic WIIFM. “What’s In It For Me?”)


The problem they solve is that often you want to put a component on your dashboard that compares a report (such as a count of something) to a target number that isn’t itself derived from that report. The perfect example would be a chart of progress toward your fundraising goal. It’s simple to make a report of this year’s closed won opportunities, total up their Amount fields, and see how much you’ve raised. But if you want to compare that to your budgeted goal you have to put that goal into the dashboard gauge component manually. If the goal changes, you have to edit the dashboard to edit the component to change the breakpoints and target on the gauge. On the first day of the fiscal year, when the report underlying the dashboard rolls itself over (Close Date = “This Year”), the dashboard is suddenly way off because it’s comparing the total raised this fiscal year with the target left over from last fiscal year! Dynamic Gauge Charts allow you to make a gauge where you set the top end and breakpoints based on the value of a field on a particular record.


Pretty cool! Now you can have a record for “Current Fundraising Goal” and point the gauge at that so that it stays current as long as that record is current. Set yourself a reminder to switch the number in the Current Fundraising Goal record on the first day of the fiscal year and all gauges on all dashboards are suddenly looking at the right new goal.


Which brings us to keeping those target records current.

Some target records are inherently manual, like the “Current Fundraising Goal” example. That’s a number that the executive leadership picks sometime before the end of the fiscal year and it’s not going to shift based on other records in Salesforce. It could be updated if circumstances change, but that’s a decision made by people.


But I frequently get clients that want an organizational metric along the lines of

75% of all students will maintain a GPA of 3.5 or better,

100% of alumni will have full-time employment,

or

90% of 8th graders will apply to competitive High Schools.

Those percentages are derived from an equation.


In the first example, the equation is:

Count of students with GPA > 3.5

____________________________

Count of Enrolled Students

The number of students, alumni, or 8th graders—the denominator, in that equation—changes. It might change on any given day (if kids are accepted or removed from the program.) The numerator of the equation takes care of itself: You get it by running a report—and reports are always up-to-date the moment they’re run. But we have to update the denominator whenever kids come or go. On a dashboard without dynamic gauge charts we would have to edit the gauge target and breakpoints every time a student leaves the program! (Or at least every time we are going to refresh the dashboard to show executives how we are doing against our organizational goals.) So much for having the dashboard at your fingertips to impress execs.


And let’s not forget that the three examples I listed all have different denominators! It’s entirely reasonable for a single program to have organizational targets like those–and probably a lot more. That could become a lot of target records to maintain.


In fact, my client The Academy Group asked me to help them put together a dashboard with exactly that kind of organizational metrics. They work with kids from 4th grade through graduation from college. So they had metrics about the % of elementary school kids, % of middle school, high school, college, plus some specific to 12th graders, etc...


It became clear very quickly that there are going to be a lot of different denominators required. I knew that just creating each of those metrics was going to be a bit of a pain in the neck:

Step 1. Create report counting students in the category. (8th graders with GPA > 3.5.)

Step 2. Put that report onto the dashboard as a gauge component.

Step 3. Run a different report to figure out the denominator. (How many 8th graders are there?)

Step 4. Edit the gauge target and breakpoints.

Rinse and repeat.

Manually updating each of those metrics even once a year would be no fun. And I know that sometimes students are removed from the program mid year and that Academy Group’s leadership is going to want to see the percentages based on the right denominator as soon as those kids leave. It occurred to me that this might be the time to try out those Dynamic Gauge Charts.


And that’s when I realized that there aren’t any records in Academy Group’s Salesforce that could serve as the targets! We have a report of, for example, enrolled students by grade, but no record for those counts. It’s not even something you could make a DLRS rollup for. (There’s no parent/child relationship.) You could make some kind of Flow to get each of those counts, but you’d basically be making a custom flow for each target denominator. That’s not sustainable!


Introducing DynamicGaugeTargets

I figured it was time to sit down and build a thing. I knew it could be a thing that was reusable for some of my other clients. And then I realized I could release it as an unmanaged package so other organizations could also use it..


So I give you DynamicGaugeTargets, a completely free, unmanaged package that gives you the ability to keep those denominators up to date automagically. The package includes a custom object (called DashboardTarget) for storing all of your dynamic gauge chart target numbers. You can have dashboardtargets that you manually update when needed. But if you want auto-updated targets all you need is a little bit of [easily Googled] SOQL know-how and flows will keep you up-to-date.


Do Try This At Home

I would love to hear your feedback! Please try DynamicGuageTargets in your sandbox or dev org. Try out my installation and post-install instructions and let me know what you think. If you find this useful, go ahead and install it in your production instance and impress your colleagues with your dynamic dynamic gauge components. 🤯


If you find an issue or a problem, the GitHub Issues tab would be a great place to log that for me. For questions or comments, please post on the Trailblazer community or in Ohana Slack so that perhaps others can join the discussion. Or, of course, you can email me directly.


I particularly want to hear your successes!

317 views

Recent Posts

See All
bottom of page