0

I'm trying to use a conditional statement in a salesforce email text template, field is a check box and i want the output in the email template to be yes or no. I'm using the below but it is not working

Catchment Waiver Required: {!IF("{Opportunity.Catchment_Waiver_Required__c}" =="0","No","Yes")}

the output is always yes despite checkbox being ticked or unticked :(

I have also tried the below {!IF(Opportunity.Catchment_Waiver_Required__c =="0","No","Yes")}

which produces nothing

Any help would be greatly appreciated!

1 Answer 1

1

First thing that comes to mind is "Don't confuse '0' with FALSE."

Second thing is "if you're using a checkbox field at all, you can skip the "==" entirely and just enclose it with a "NOT()", like so:

{!IF(NOT({Opportunity.Catchment_Waiver_Required__c}),"No","Yes")}

Edit: you don't even need a NOT(): just switch the "No" and the "Yes". That gets you this:

{!IF({Opportunity.Catchment_Waiver_Required__c},"Yes","No")}

2
  • thank you for the advice but the above did not work for me, unfortunately. I manged to get it working like this {!IF(Opportunity.Catchment_Waiver_Required__c , "Yes", "No")}
    – Marie
    Feb 8, 2023 at 12:38
  • Well, that definitely skips the "==". Also the "NOT()". Will update the answer accordingly. Feb 8, 2023 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .