Activity Forums Salesforce® Discussions How to show image file in salesforce lightning record using formula field?

  • PRANAV

    Member
    January 3, 2018 at 2:53 pm

    Hi Ahmed,

    Please follow the below steps to create a formula field that shows an image:

    • Create a public folder to hold your image files.

    1. Click the Documents tab.
    2. Click Create New Folder.
    3. Enter the folder name (for example, "Public Folder").
    4. Give users "Read-Only" access to the folder and make it accessible to all users.

    • Upload your image file to your Documents storage area.

    1. Click the Documents tab.
    2. Click New.
    3. Enter the document name to be displayed on the browser.
    4. From the "Folder" pick-list, select the folder you created in step 1.
    5. Click Browse to look for and select the file to upload.
    6. Click Save.

    • Create a new "Text" type Formula Field.

    1. Go to Setup | Customize | <Object>
    2. Click Fields.
    3. Under "Custom Fields," click New.
    4. Select Formula and Click Next.
    5. Enter your custom field name, then select Text from the "Formula Return Type" and Click Next.
    6. In the "Enter Formula" screen, click Advanced Formula.

    • Obtain the URL to the files you uploaded

    1. Click the Documents tab.
    2. From the "Folder" picklist, select the folder you created in step 1 and Click Go.
    3. Click View next to the name of the file you want to use.
    - A new browser window or browser tab opens.
    4. In the browser's address bar, select and copy the URL.

    • Enter your image URL into your Formula Field using the "IMAGE" function.

    1. In the text area, enter your formula using IMAGE to retrieve the image file you uploaded in step 2.
    2. Paste the image document URL into the 'image_url' portion of the IMAGE function.

    Notes

    Don't include the Salesforce domain ("https://www.salesforce.com") in your URL.
    URLs must be enclosed in double-quotes, for example: "/servlet/servlet.FileDownload?file=0150K000006Wjbp"

    • Grant the appropriate Field-Level Security to your Formula Field.
    • Include the Formula Field in all the relevant Page Layouts.
    • Click on Save button

    Hope this helps you.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos