function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Terry_0101Terry_0101 

Help - formula field not working

Hi,
This is a formula field with TEXT data type, but I get this error:    : (

Error: Incorrect number of parameters for function 'IMAGE()'. Expected 2, received 1

IF(
checkbox__c = TRUE,
IMAGE('/servlet/servlet.FileDownload?file=015w0000003GGGG')
)
RobAlexanderRobAlexander
Hi, Terry. The IMAGE function requires 2 parameters:
  • image_url
  • alternate_text

You're missing the 2nd one.
Amit Chaudhary 8Amit Chaudhary 8
It should be like below

IF(
checkbox__c = TRUE, IMAGE('/servlet/servlet.FileDownload?file=015w0000003GGGG' , 'Green') ,
 IMAGE('/servlet/servlet.FileDownload?file=015w0000003GGGG' , 'Green')
)
Please check below post
https://help.salesforce.com/HTViewSolution?id=000007604

Let us know if this will help you
Ajay K DubediAjay K Dubedi
Hi Terry,

Incorrect number of parameters for function 'IMAGE()'. Expected 2, received 1 shows that 'Image' function missed one parameter, try the below code I think it may be helpful.
IF(
checkbox__c = TRUE,
IMAGE('/servlet/servlet.FileDownload?file=015w0000003GGGG',param)
)
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks,
Ajay Dubedi