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
Jared KaneJared Kane 

Help With an IF(ISPICKVAL formula

I am trying to have a dollar sign image show up on another field called stage_indicator__c whenever "delivered" from the stage picklist is chosen.Whenever other value is chosen from the picklist, I want it to be blank. My current formula isnt working. Any thoughts on where i'm going wrong? Im pretty new to this. 

IF(ISPICKVAL(Stage_Name__c, "Delivered"),"IMAGE("/servlet/servlet.FileDownload?file=015A0000003mNPL","")
 
Best Answer chosen by Jared Kane
Jason Curtis NBSFDGJason Curtis NBSFDG
Hi, Jared, to syntax for the IF fucntion is: IF(logical_test, value_if_true, value_if_false).
Basically your IF function is testing the first condition, if that is TRUE (in this case StageName = Delivered), then it is displaying your image. If it isn't true then you are displaying nothing (""). 
What you want to do is the first IF isn't true is do another IF statement inside your first one, so if the first one doesn't evaluate as true the formulat will test the second one, you can continue to nest IF statements like this. Here is an exmaple, I didn't give it a new image ID for the second image function so you will need to update, and be careful tha tyou have the right number of closing paretheses.
 
IF(ISPICKVAL( StageName, "Delivered"), IMAGE("/servlet/servlet.FileDownload?file=015A0000003mNPL",""), IF(ISPICKVAL( StageName, "Closed Lost"), IMAGE("/servlet/servlet.FileDownload?file=015A0000003mNPL",""),""))

 

All Answers

Balaji BondarBalaji Bondar
Hi Jared,
Use below formula:
IF(ISPICKVAL( StageName, "Delivered"), IMAGE("/servlet/servlet.FileDownload?file=015A0000003mNPL",""), "")
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
Jared KaneJared Kane
This worked perfectly... One more question that hopefully you can help me with. How would I go about adding another IF(ISPICKVAL formula to the formula above. I am trying to say if "Closed lost" is chosen from the picklist then another image is shown. Thanks for your help! 
Jason Curtis NBSFDGJason Curtis NBSFDG
Hi, Jared, to syntax for the IF fucntion is: IF(logical_test, value_if_true, value_if_false).
Basically your IF function is testing the first condition, if that is TRUE (in this case StageName = Delivered), then it is displaying your image. If it isn't true then you are displaying nothing (""). 
What you want to do is the first IF isn't true is do another IF statement inside your first one, so if the first one doesn't evaluate as true the formulat will test the second one, you can continue to nest IF statements like this. Here is an exmaple, I didn't give it a new image ID for the second image function so you will need to update, and be careful tha tyou have the right number of closing paretheses.
 
IF(ISPICKVAL( StageName, "Delivered"), IMAGE("/servlet/servlet.FileDownload?file=015A0000003mNPL",""), IF(ISPICKVAL( StageName, "Closed Lost"), IMAGE("/servlet/servlet.FileDownload?file=015A0000003mNPL",""),""))

 
This was selected as the best answer
Jared KaneJared Kane
Thanks Jason, it worked perfectly!