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
loyamaloyama 

Can Someone Please Help Me with this CASE with Image from Picklist Formula????

I am trying to display a different colored flag based on a value chosen in a PickList field on the same screen.  Here is my code:

 

CASE ({!CSAT},
"Satisfied", "IMAGE("https://na2.salesforce.com/01540000000iFMJ", "Green_Flag") ",
"Some Concerns", "IMAGE("https://na2.salesforce.com/01540000000iFMO", "Yellow_Flag") ",
"Not Satisfied", "IMAGE("https://na2.salesforce.com/01540000000iFM9", "Red_Flag") ",
"None")

 

When I check the Syntax I get: ".....Syntax Error:  Missing ")" and it is highlighting the above where I did a strike through.  I have tried many variations of this code and cannot get past errors.

 

Can anyone help me?  I'd really appreciate it!

Best Answer chosen by Admin (Salesforce Developers) 
netTrekker_ADnetTrekker_AD

Here is an example of a CASE function we use with the IMAGE function:

 

 

IMAGE( CASE( AccountName,
"Name1", "servlet/servlet.FileDownload?file=015Q0000000DFhU",
"Name2", "servlet/servlet.FileDownload?file=015Q0000000DFhP",
"Name3", "servlet/servlet.FileDownload?file=015Q0000000DFhK",
"Name4", "servlet/servlet.FileDownload?file=015Q0000000DFhK",
"Name5", "servlet/servlet.FileDownload?file=015Q0000000DFhK",
"Name6", "servlet/servlet.FileDownload?file=015Q0000000DFhU",
"None"),
"Logo")

 

 

You need to use "servlet/servlet.FileDownload?file=InsertImageIDHere" rather than URLs as you have in your code.

All Answers

netTrekker_ADnetTrekker_AD

Here is an example of a CASE function we use with the IMAGE function:

 

 

IMAGE( CASE( AccountName,
"Name1", "servlet/servlet.FileDownload?file=015Q0000000DFhU",
"Name2", "servlet/servlet.FileDownload?file=015Q0000000DFhP",
"Name3", "servlet/servlet.FileDownload?file=015Q0000000DFhK",
"Name4", "servlet/servlet.FileDownload?file=015Q0000000DFhK",
"Name5", "servlet/servlet.FileDownload?file=015Q0000000DFhK",
"Name6", "servlet/servlet.FileDownload?file=015Q0000000DFhU",
"None"),
"Logo")

 

 

You need to use "servlet/servlet.FileDownload?file=InsertImageIDHere" rather than URLs as you have in your code.

This was selected as the best answer
loyamaloyama

OMG - THANK YOU!  You don' know how long I worked on this.  Thank you thank you thank you - it works!!!!!!!

netTrekker_ADnetTrekker_AD

Glad I could help. Good luck!