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
ahonahon 

Email Template: only merge picklist value if specific value

Is there a formula or way to specify: if picklist field has certain value on record, do not insert merge field on email template? 

For example, picklist values are x, y, z. If picklist field value is x, do not merge on template.
Best Answer chosen by ahon
ahonahon
To give a bit more context, I'm working with a Visualforce markup within an HTML table on an email template. I actually needed an entire row to be hidden (or conditionally visible) based on the picklist value on record. This solution or formula seems to be working:

<apex:outputPanel rendered="{!Components.Component_Status__c != 'Open'}">

All Answers

VinayVinay (Salesforce Developers) 
Hi Allison,

To conditionally exclude a merge field in an email template in Salesforce based on the value of a picklist field on a record, you can use an IF formula in the email template.
  • Edit the email template's HTML or plain text body depending on the type of template you're using.
  • Locate the position in the template where you want to include the merge field based on the picklist field's value.
{!IF( picklist field !=null, '', 'mergeField')}
Please mark as Best Answer if above information was helpful.

Thanks,
ahonahon
Based on your reply it sounds like you understand what Im trying to achieve, but this formula made the picklist value display as blank, or whatever value is between ''

Im trying to get the following to work:
If picklist value on record is "Open", do not display on email template / do not merge.
ahonahon
To give a bit more context, I'm working with a Visualforce markup within an HTML table on an email template. I actually needed an entire row to be hidden (or conditionally visible) based on the picklist value on record. This solution or formula seems to be working:

<apex:outputPanel rendered="{!Components.Component_Status__c != 'Open'}">
This was selected as the best answer