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
pmozz01pmozz01 

Image formula based on Lead Score

I have a calculated lead score field and would like to display a star rating based on the numerical values.  Here's the code I did, but I cannot even save it as it says I have a "syntax error" and highlights the first less than operator.

IMAGE(
     IF(Total_Lead_Score__c ,  < 650, "/img/samples/stars_100.gif",
         IF (AND  (Total_Lead_Score__c ,  > 649, Total_Lead_Score__c <  799,  "/img/samples/stars_200.gif", "2 stars"),
               IF (AND (Total_Lead_Score__c ,  > 800,
      "/img/samples/stars_300.gif", "3 stars"))), "Star Rating")
)

pmozz01pmozz01
I have also tried the formula this way, but it still gives me the syntax error at the first operator.

IF(Total_Lead_Score__c ,  < 650,  IMAGE ("/img/samples/stars_100.gif", "1 Star"),

         IF (AND  (Total_Lead_Score__c ,  > 649, Total_Lead_Score__c <  799,  IMAGE ("/img/samples/stars_200.gif", "2 stars"),
 
              IF (AND (Total_Lead_Score__c ,  > 800, IMAGE("/img/samples/stars_300.gif", "3 stars"))), "Star Rating")
)
ndunnndunn

From what I can see, you don't want a comma between your field and the "less than" operator. I've made my recommended changes to your formula below.

 


IMAGE(
     IF(Total_Lead_Score__c  < 650, "/img/samples/stars_100.gif",
         IF (AND  (Total_Lead_Score__c  > 649, Total_Lead_Score__c <  799,  "/img/samples/stars_200.gif", "2 stars"),
               IF (AND (Total_Lead_Score__c  > 800,
      "/img/samples/stars_300.gif", "3 stars"))), "Star Rating")
)


Where did you get the star images from? I'd like to implement a similar field for my company.

 

Thanks.

 

Nathan

 

pmozz01pmozz01
Thanks, I finally did get that working correctly.  I got the "Sample Image Formula Fields 1.0" from the AppExchange back in 2007, but I do not see it there anymore.  However, if you open the Help menu in SFDC and lookup "Image links" you will find them there with some instruction on how to implement.