You need to sign in to do that
Don't have an account?
Nadia Ayoub
Image Formula field based on Picklist Value
Hi,
I'm fairly new to formula fields and am having trouble with this one. I want to display various images depending on which picklist value is chosen. Here is one formula I've tried, and am getting a very confusing error message :(
Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 9
Could anyone guide me in the right direction? Thanks!
IMAGE (
ISPICKVAL (
Contact_Status_Data__c,
"Active", "img/msg_icons/confirm32.png",
"Inactive", "img/msg_icons/error32.png",
"Non-Serviced", "img/msg_icons/warning32.png",
"No Volume", "img/msg_icons/info32.png"
))
I'm fairly new to formula fields and am having trouble with this one. I want to display various images depending on which picklist value is chosen. Here is one formula I've tried, and am getting a very confusing error message :(
Error: Incorrect number of parameters for function 'ISPICKVAL()'. Expected 2, received 9
Could anyone guide me in the right direction? Thanks!
IMAGE (
ISPICKVAL (
Contact_Status_Data__c,
"Active", "img/msg_icons/confirm32.png",
"Inactive", "img/msg_icons/error32.png",
"Non-Serviced", "img/msg_icons/warning32.png",
"No Volume", "img/msg_icons/info32.png"
))
For your case - you will need to use a nested if formula.
Something like this
IMAGE(
IF(ISPICKVAL(Contact_Status_Data__c, "Active"), "img/msg_icons/confirm32.png",
IF(ISPICKVAL(Contact_Status_Data__c, "Inactive"), "img/msg_icons/error32.png",
IF(ISPICKVAL(Contact_Status_Data__c, "Non-Serviced"), "img/msg_icons/warning32.png"),
IF(etc....))
)
)
Or you can also try out the case formula that will be much more easier
IMAGE(
CASE(Contact_Status_Data__c,
"Active", "img/msg_icons/confirm32.png",
"Inactive", "img/msg_icons/error32.png",
"Non-Serviced", "img/msg_icons/warning32.png",
"No Volume", "img/msg_icons/info32.png",
"/s.gif"),
"contact status")
Thanks,
Kaustav
All Answers
For your case - you will need to use a nested if formula.
Something like this
IMAGE(
IF(ISPICKVAL(Contact_Status_Data__c, "Active"), "img/msg_icons/confirm32.png",
IF(ISPICKVAL(Contact_Status_Data__c, "Inactive"), "img/msg_icons/error32.png",
IF(ISPICKVAL(Contact_Status_Data__c, "Non-Serviced"), "img/msg_icons/warning32.png"),
IF(etc....))
)
)
Or you can also try out the case formula that will be much more easier
IMAGE(
CASE(Contact_Status_Data__c,
"Active", "img/msg_icons/confirm32.png",
"Inactive", "img/msg_icons/error32.png",
"Non-Serviced", "img/msg_icons/warning32.png",
"No Volume", "img/msg_icons/info32.png",
"/s.gif"),
"contact status")
Thanks,
Kaustav
Some Question Occours for myself
What is this part in the formula code "contact status" .
I understand everything but not the last row from the formula code ...
best regards john s.
It's possible to do the same but also by month?
Like - put the image only if it's the last month? Or May month?
ya i got the above formula so i have one concern if there are 3 picklist filed than at that case what will be work.like
for ex- Adm201 ,pD-1,pd2 3 picklist are there if Adm201 is certified the image came if not another image so like that pd1 & Pd2 image aslo came in at one time ...
so how can we do this please help me on this