---
schema_version: "1"
id: 7a9723db2ada852eafe03d8f4a679506956f292b9ff6204965f1e55b80faead9
title: Sample Image Link Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/useful_advanced_formulas_image_links.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.useful_advanced_formulas_image_links.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: fe29e456c430d60a53b6acad97c73cead2db327353b44a30b19a41a1a42d3bbd
description: Visualize case priority, case age, project status, ratings, and scores with images such as flags, colored indicators, star ratings, and proportional bars.
products:
  - Salesforce Platform
  - Security
release: "264"
---
# Sample Image Link Formulas

Visualize case priority, case age, project status, ratings, and scores with images such as flags, colored indicators, star ratings, and proportional bars.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Essentials</strong>, <strong>Group</strong>, <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

For details about using the functions included in these samples, see [Formula Operators and Functions by Context](https://help.salesforce.com/s/articleView?id=platform.customize_functions.htm&release=264.0.0&type=5 "Use these operators and functions when building formulas. All functions are available everywhere that you can include a formula, such as formula fields, validation rules, approval processes, and workflow rules, unless otherwise specified.").

## Yahoo! Instant Messenger™ Image

This formula displays an image that indicates whether a contact or user is logged in to Yahoo! Instant Messenger. Clicking the image launches the Yahoo! Instant Messenger window. This formula uses a custom text field called Yahoo Name to store the contact or user’s Yahoo! ID.

```
IF(ISBLANK(Yahoo_Name__c),"", HYPERLINK("ymsgr:sendIM?" & Yahoo_Name__c, 
IMAGE("http://opi.yahoo.com/online?u=" & Yahoo_Name__c & "&m=g&t=0", " ")))
```

## Flags for Case Priority

This formula displays a green, yellow, or red flag image to indicate case priority.

```
IMAGE( 
CASE( Priority, 
"Low", "/img/samples/flag_green.gif",
"Medium", "/img/samples/flag_yellow.gif",
"High", "/img/samples/flag_red.gif", 
"/s.gif"), 
"Priority Flag")
```

## Color Squares for Case Age

This formula displays a 30 x 30 pixel image of a red, yellow, or green, depending on the value of a Case Age custom number field.

`IF( Case_Age__c > 20,  IMAGE("/img/samples/color_red.gif", "red", 30, 30), IF( Case_Age__c > 10, IMAGE("/img/samples/color_yellow.gif", "yellow", 30, 30), IMAGE("/img/samples/color_green.gif", "green", 30, 30) ))`

## Traffic Lights for Status

This formula displays a green, yellow, or red traffic light images to indicate status, using a custom picklist field called Project Status. Use this formula in list views and reports to create a “Status Summary” dashboard view.

```
IMAGE( 
CASE(Project_Status__c, 
"Green", "/img/samples/light_green.gif",
"Yellow", "/img/samples/light_yellow.gif",
"Red", "/img/samples/light_red.gif", 
"/s.gif"), 
"status color")
```

## Stars for Ratings

This formula displays a set of one to five stars to indicate a rating or score.

```
IMAGE( 
CASE(Rating__c, 
"1", "/img/samples/stars_100.gif",
"2", "/img/samples/stars_200.gif",
"3", "/img/samples/stars_300.gif", 
"4", "/img/samples/stars_400.gif", 
"5", "/img/samples/stars_500.gif", 
"/img/samples/stars_000.gif"), 
"rating")
```

## Consumer Reports™—Style Colored Circles for Ratings

This formula displays a colored circle to indicate a rating on a scale of one to five, where solid red is one, half red is two, black outline is three, half black is four, and solid black is five.

```
IMAGE( 
CASE(Rating__c, 
"1", "/img/samples/rating1.gif",
"2", "/img/samples/rating2.gif",
"3", "/img/samples/rating3.gif", 
"4", "/img/samples/rating4.gif", 
"5", "/img/samples/rating5.gif", 
"/s.gif"), 
"rating") 
```

## Horizontal Bars to Indicate Scoring

This formula displays a horizontal color bar (green on a white background) of a length that is proportional to a numeric score. In this example, the maximum length of the bar is 200 pixels.

```
IMAGE("/img/samples/color_green.gif", "green", 15, Industry_Score__c * 2) & 
IMAGE("/s.gif", "white", 15, 
200 - (Industry_Score__c * 2))
```