Display an Image as a Custom Field on Salesforce

There are many times when we need to display an image as a custom field like when the status of a contact is changed to pending or accepted.

Though this is possible natively on it is not so direct. Here’s an example that will illustrate how to display an image on/as a custom field on

You need to be an administrator or should have the permissions to modify Objects.


We need to upload the image to be used

  1. Navigate to All tabs –> Documents tab–> click “new” button
  2. Fill in the details of your file, make it externally available, and click save
  3. Once the image is saved, keep a note of its record ID, which can be found on the URL (ex: 015U0000000HxC9)

Now we need to add a custom field to the object where we need to display the image, here I am adding it to a custom object

  1. Navigate to Setup–> Create–>Objects–> (custom Object) –> Add new custom field
  2. In Step 1 Select the field type as “formula” and click next
  3. In Step 2 Select the Field Return type as “Text”
  4. In Step 3 Select the Advanced Formula,

Specify the condition on which the image is to be displayed. E.g. I want to display this image when my status field is set to “accepted”, therefore I write an IF condition



IMAGE(‘/servlet/servlet.FileDownload?file = 015U0000000HxC9’,””),


Replace the Record ID of your file on the highlighted code.

  1. In steps 4 & 5 select the settings you wish and click save.

Now you can see the image on the page layout according to your specified formula.

Hope this helped you. Please leave a comment if you need any help regarding this post or any other issues.


Select a Child Category
Recent Posts
Social Links

Related Posts

Want to Learn More?

Milestone experts take the time to listen, understand your needs, and provide the right mix of tools, technology, and resources to help you meet your goals.

Request a complimentary consultation to get started.

Request a Complimentary Consultation

Skip to content