One of Salesforce’s most attractive features is the ability to customise anything and everything. Buying an off the shelf product but being able to completely tailor it to your unique business processes is one of the reasons Salesforce is No 1. A feature that has been around for quite some time, is the ability to add images to Salesforce formula fields. This essentially means instead of calculating a number, or outputting a string of text, the formula fields “result”, can be a series of images depending on the scenario. Our friends over at Salesforce Labs have given us some basic images for quite some time, however with the recent overhaul of the Graphics Pack on the AppExchange, we have a whole host of icons to play around with.
If you’ve ever seen an official Salesforce demo, you might notice that they put a huge amount of effort into using images and icons to show different states of records. The reason? It looks a lot more aesthetically pleasing and information can be digested quicker. Let’s look at a few examples where icons can be tremendously helpful in improving the usability and aesthetics of your Org.
1. Account Health Rating – Could be based on last activity date, or other metrics you hold in your Org.
2. Case Status Image – Simply based off of the Case Status to quickly show which cases need attention
3. Lead Score – Can be based on the rating field or a custom lead score field
Now that you’ve seen the power of images, let’s have a look at how to implement them. Before making changes to your Org, I would ask yourself the question, “Where can my users benefit the most from images?”. You don’t want to just start using images for the sake of it, but to help users get a glimpse of the status of their data.
1. Install the Graphics Pack – Using the following link, install the Graphics Pack from Salesforce Labs. This will give you access to pages and pages of icons.
2. Create a Formula Field – The next step is to create a formula field with the output type of Text
3. Prepare your output – Before creating your formula field, it’s a good idea to select the graphics you want to use and prepare the output that you will use. The images displayed are encased in the formula field function IMAGE. This is used in the following method… IMAGE(“Image URL”, “Alt text”). The Image URL is accessible once clicking on any image in the graphics pack, and you need to remember to grab everything after and including “/resource/….”. Alt text is simply a placeholder just in case the image can’t be displayed.
4. Create an IF or CASE Statement – The most common way to use image fields is using an IF or CASE statement. Reason being, you want your image to be dynamic based on data stored in the record. If we take a look at the Lead score examples from above, our case statement looks like this…
CASE(Rating, “Hot”, IMAGE(“/resource/1523798147000/GraphicsPackNew/silk/16/silk/medal_gold_1.png”, “Hot”),
“Warm”, IMAGE(“/resource/1523798147000/GraphicsPackNew/silk/16/silk/medal_silver_1.png”, “Warm”),
Account Health Rating
CASE(Account_Health__c, “Good”, IMAGE(“/resource/1523798147000/GraphicsPackNew/tangodesktopproject/16/theme/dialog-error.png”, “Red”),
“Ok”, IMAGE(“/resource/1523798147000/GraphicsPackNew/tangodesktopproject/16/theme/emblem-important.png”, “Orange”),
CASE(Status, “New”, IMAGE(“/resource/1523798147000/GraphicsPackNew/silk/16/silk/star.png”, “New”),
“Working”, IMAGE(“/resource/1523798147000/GraphicsPackNew/silk/16/silk/comments.png”, “Working”),
“Escalated”, IMAGE(“/resource/1523798147000/GraphicsPackNew/silk/16/silk/flag_red.png”, “Escalated”),