0

I have a formula field on which I am displaying a svg image using the IMAGE function. I have no issues displaying the image, but the image displayed is not left aligned. Here is formula I am using in the formula field -

IMAGE(
 CASE( test_field__c,
  "1", "/resource/CustomImages/image1.svg", 
  "2", "/resource/CustomImages/image2.svg", 
  'No Image'
 ),
 "Image", 22, 250
)

And here is how the image is displayed in the UI -

enter image description here

I am trying to have the image displayed exactly on line with the column header.

1 Answer 1

1

The "Image" function does not have any property related to the position of the image. I would suggest you to kindly the check the image itself, there could be some space on the left of image itself. Second (not associated to the problem) but to improve readability of the formula, may be consider keeping "CASE" outside, like

CASE(test_field__c,
"1", IMAGE("/resource/CustomImages/image1.svg", "Thumbs up",  22, 250),
"2", IMAGE("/resource/CustomImages/image2.svg", "Thumbs down, 22, 250),
"No Image")
3
  • Hello Mahmood, There is no space in the on the left of image. When the svg image is opened in the viewer it previews perfectly without the space.
    – sumchans
    Aug 22, 2022 at 19:10
  • 1
    Have you tried reducing the width of the image in image function. Instead of 250, try 100
    – Mahmood
    Aug 22, 2022 at 20:28
  • Yes Mahmood, that was what I was doing wrong. It finally worked for me.
    – sumchans
    Aug 23, 2022 at 16:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .