am fairly new to Salesforce and do not come from a technical background so struggling with Formulas. I am trying to achieve the following logic; If the NPG Triage Result Code is 5, 7, 9, 21, 99 then Yellow Flag, for any other value Red Flag, or if blank then blank.
IF(
OR(
NPG_Triage_Result_Code__c = 5,
NPG_Triage_Result_Code__c = 7,
NPG_Triage_Result_Code__c = 9,
NPG_Triage_Result_Code__c = 21,
NPG_Triage_Result_Code__c = 99
)
),
IMAGE("/img/samples/flag_yellow.gif","Yellow"),
IMAGE("/img/samples/flag_red.gif", "Red")
)
I am unsure how to show the different values that need the yellow flag more efficiently, and struggling to show the any other value = red flag and no value = blank part. I also keep running up against errors. The one I am getting for above is -
Error: Syntax error. Extra IMAGE
I have now tried different versions of the code
IF(
ISBLANK(NPG_Triage_Result_Code__c),
"",
IF(
CONTAINS("5:7:9:21:99", NPG_Triage_Result_Code__c),
IMAGE("/img/samples/flag_yellow.gif","Yellow"),
IF(
CONTAINS("1:2:3:4:6:8:10:11:12:20:98:400:500", NPG_Triage_Result_Code__c),
IMAGE("/img/samples/flag_red.gif", "Red")
)
)
)
But am running across a new error -
Incorrect parameter type for function 'CONTAINS()'. Expected Text, received Number (Related field: Formula)
When trying the CASE function
CASE(
NPG_Triage_Result_Code__c,
"5:7:9:21:99", IMAGE("/img/samples/flag_yellow.gif","Yellow"),
"1:2:3:4:6:8:10:11:12:20:98:400:500", IMAGE("/img/samples/flag_red.gif", "Red")
)
I get this error -
Incorrect number of parameters for function 'CASE()'. Expected 4, received 5 (Related field: Formula)
Am getting a bit lost trying to find SF specific help for it in the documents so even if I could be pointed to the right reference docs that would be a massive help. Thank you!
)
). One of the basic rules is that parenthesis must be "balanced". You need the same number of open and close parenthesis.