Display an icon on a record page

You can use a formula field to display an icon on a record page. For example, you can display a country flag on a team member record, or an icon to indicate disability or other needs on a candidate record.

For example: 

  • A country flag on the team member record:

    Screenshot: Country flag on a team member record

  • An icon indicating disability on a candidate record:

    Screenshot: An icon and a Has Disability? field on a candidate record

This example walks you through the steps of adding an icon to the candidate record. The steps you need to take: 

  1. Gather the icons you want to use. If necessary, resize them at this stage.

  2. Add the icons into Files in your org:

    1. In your org, select the App Launcher and then select Files:

      Screenshot: Selecting Files from the App Launcher

    2. In Files, select the library where you want to upload the icons. Make sure you select a public library, such as the Asset Library in the screenshot:

      Screenshot: In Files, selecting the library

    3. In the library, select Upload Asset File:

      Screenshot: Selecting Upload Asset File

    4. After uploading select the image name to open it in preview mode: 

      Screenshot: Selecting the image name in the library to open in preview mode

    5. In the preview mode right click and select Copy image address.

      Screenshot: Selecting Copy image address in the image preview

      The copied image address looks something like this: https://<org domain>.file.force.com/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Png&versionId=068QH000001IHRd&operationContext=CHATTER&contentId=05TQH000002qT9p

      To use the image in a formula field you only need the parts starting from /sfc/.

  3. Add a formula field to the candidate record:

    1. Go to Setup > Object Manager, and select the Candidate object.

    2. From the sidebar select Fields & Relationships.

    3. Select New and create the new field with the following details: 

      • Field data type: Formula

      • Formula return type: Text

      • Formula: IMAGE(image_url, alternate_text, height, width) where:

        • image_url is the image address you copied from the image details, in quotation marks.

        • alternate_text is the text to display if the image cannot be displayed, also used by screen readers.

        • height is the image height in pixels. Optional.

        • width is the image width in pixels. Optional.

          Not entering height and width can lead to the icon being not displayed in full in reports.

        For example: IMAGE("/sfc/servlet.shepherd/version/renditionDownload?rendition=ORIGINAL_Png&versionId=068QH000001IHRd&operationContext=CHATTER&contentId=05TQH000002qT9p", "Disability_Icon", 30, 30)

        You can combine the IMAGE function with an IF condition to only display the image if the condition of true. For example:

        Copy

        Example: IF with IMAGE

        IF(
        Has_Disability__c,
        IMAGE("<image address>", "Disability icon", 30, 30),
        NULL
        )