#nocode Progress Bars You Can Create Today on ANY Object

Kevin Zeigler
Mission: Impactful
Published in
3 min readFeb 23, 2022

Ever wish you could put a visual reference on how much of something you’ve completed in Salesforce? Can’t write a line of code? This post is for you, my friend. Impress your friends with your new party trick, formula field progress bars.

I’m going to do this on the Campaign object since it was a use case from a recent customer of mine. Just know that all you need is a percentage derived from two numbers (e.g., actual vs. target, two dates, consumed vs. available) and you’re in business.

Step 1: Upload Image Files

You’ll need two images for this basic progress bar. Feel free to use the images here or create your own. I created these to stick to the Salesforce Lightning Design principles.

Upload each of these to Static Resources as shown below.

Uploading a static resource file.

You’ll need to grab the tail end of the URL after you upload. Copy and paste this somewhere safe. We’ll use this in Step 3.

Step 2: Create the Percentage Complete Field on the Campaign Object

We’ll be comparing today’s date [TODAY()] to the start date [StartDate] to calculate how many days have passed since the start date. We divide this by the total number of days in the entire campaign [EndDate — StartDate]. Since we don’t want the percentage getting larger than 100%, we use MIN to limit the percentage.

Percent complete field on the Campaign object.

All of that to say, you can copy and paste the formula below:

MIN((TODAY()-StartDate)/(EndDate — StartDate),1)

Step 3: Create the Progress Bar Formula Field

Create another formula field (Text) on the Campaign object to host the progress bar. This formula is pretty cool, we are putting our two images together (BlueProgress and GrayProgress) then stretching each to width using the Percent Complete field.

Progress field on the Campaign object.

Here’s your copy and paste opportunity:

IMAGE(“/resource/1645123036000/BlueProgress?”, “Blue”, 15, Percent_Complete__c * 100) &
IMAGE(“/resource/1645123094000/GrayProgress?”, “Gray”, 15, (1 — Percent_Complete__c)*100)

*NOTE: Your static resource links will be different. Use the links you copied from Step 1.

Step 4: Marvel in Your Glory

You’re now ready to use your field. I showed this to the customer in a list view, but you can also view in on the record itself. Here’s my example! You can even sort on the field (although note that the 100% will always show at the ends).

Campaign list view with newly created progress bar.

Pretty cool, huh? Now go forth and CREATE! ✌️

NOTE: Please note that the information in this blog post is not intended to be Salesforce implementation advice. As a Solution Engineer, I build solution demos that highlight what you can do with Salesforce, not necessarily what you should do in your production environment. You should always solicit the advice of an experienced, certified Salesforce partner when making implementation decisions.

--

--