I am with a doubt, as you can see in the formula I want to show different images depending on the picklist value that he choses, and until know the formula it was ok, but now I want that in the 3 if, he can choose more than one value: eg: it can choose "Enviado para a FPT" or "Enviado para a BCE" or "Enviado para a APT" and the image will be the same, I know that I need to use a OR but I am stuck.

IF(ISPICKVAL(Estado__c, "Novo"), IMAGE("/resource/PB25","Novo",100,100),
IF(ISPICKVAL(Estado__c, "Enviado para o Clube"), IMAGE ("/resource/PB50",
 "Enviado para o Clube",100,100),
IF(ISPICKVAL(Estado__c, "Enviado para a FPT") , IMAGE ("/resource/PB75",
 "Enviado para a FPT",100,100),
IF(ISPICKVAL(Estado__c, "Fechado - Resolvido"), IMAGE("/resource/PB100","Fechado - Resolvido",100,100),null))))

Thanks in advance

IF(OR(ISPICKVAL(Estado__c, "Enviado para a FPT"),ISPICKVAL(Estado__c, "Enviado para a BCE"),ISPICKVAL(Estado__c, "Enviado para a APT")) , IMAGE ("/resource/PB75",
 "Enviado para a FPT",100,100)

The OR is very simple to use


where fn1,fn2 and fn3 are logical statements or functions


I'd probably choose to do this with the CASE() function and srap the OR() as it keeps down the nesting and ISPICKVAL statements. With decent formatting it makes the formula very easy to read an understand, and should you decide to use a different image for one of the values later, the change is super easy to make.

CASE (Estado__c,
  "Novo",                 IMAGE("/resource/PB25","Novo",100,100),
  "Enviado para o Clube", IMAGE ("/resource/PB50", "Enviado para o Clube",100,100),
  "Enviado para a FPT",   IMAGE ("/resource/PB75", "Enviado para a FPT",100,100),
  "Enviado para a BCE",   IMAGE ("/resource/PB75", "Enviado para a FPT",100,100),
  "Enviado para a APT",   IMAGE ("/resource/PB75", "Enviado para a FPT",100,100),
  "Fechado - Resolvido",  IMAGE("/resource/PB100","Fechado - Resolvido",100,100),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.