1

This formula is doing everything that I want except showing the actual Image on the field. Instead it shows the image address.

Image field

IF( AND(ISPICKVAL(Asset.LBS__c, 'Active'),ISPICKVAL(Asset.Swap__c, 'Standard')), 'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwK',

IF(ISPICKVAL(Asset.LBS__c, 'Active'), 'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwA',

IF(ISPICKVAL(Asset.Swap__c, 'Standard'), 'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwF', '')))

I was going to append the image addresses with "Error',90,40),'') but it wont pass the syntax check.

'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwA','Error', 90,40),'')

1 Answer 1

1

You're using a string, not a formula, so you can't just add that on.

Instead, try this:

IMAGE(
    IF( 
        AND(
            ISPICKVAL(Asset.LBS__c, 'Active'),
            ISPICKVAL(Asset.Swap__c, 'Standard')
        ), 
        'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwK',
        IF(
            ISPICKVAL(Asset.LBS__c, 'Active'), 
            'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwA',
            IF(
                ISPICKVAL(Asset.Swap__c, 'Standard'), 
                'https://customdomain--sandbox.sandbox.file.force.com/servlet/servlet.FileDownload?file=0150w000000NPwF', 
                ''
            )
        )
    ), 
    'Error', 
    90, 
    40
)
6
  • Champion of Champions! Aug 16, 2022 at 22:51
  • I notice that if the the formula doesn't contain any of the values the image field contains a corrupted image and the word error. Do I need to do something to the end of the formula. Ideally i'd like it to be blank if it doent meet the criteria. Sep 1, 2022 at 6:27
  • @QuangoBruce You will probably want to add a check at the beginning: IF( ISPICKVAL(Asset.LBS__c, 'Active') || ISPICKVAL(Asset.Swap__c, 'Standard'), ..., NULL) if you want to not emit an image if none of the situations apply.
    – sfdcfox
    Sep 1, 2022 at 7:30
  • Hi - Still getting errors - Have I put this in the right place: IF( (ISPICKVAL( LDS__c, 'Active') || ISPICKVAL(Swap__c, 'Standard') , 'mydomain--sandbox.sandbox.file.force.com/servlet/…), IF( ISPICKVAL(LDS__c, 'Active'), 'mydomain--sandbox.sandbox.file.force.com/servlet/…', IF( ISPICKVAL(Swap__c, 'Standard'), 'mydomian--sandbox.sandbox.file.force.com/servlet/…', '' ) ) ) , "Error", 60, 90 ) Sep 5, 2022 at 1:52
  • @QuangoBruce (ISPICKVAL( LDS__c, 'Active') || ISPICKVAL(Swap__c, 'Standard') ,'mydomain--sandbox.sandbox.file.force.com/servlet/…) the parentheses at the very beginning and very end should not be there. In addition, you forgot the IMAGE part.
    – sfdcfox
    Sep 5, 2022 at 3:05

You must log in to answer this question.

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