0

I have a picklist custom field in the Contact object, Chats_Reward__c which has five values: Ribbon, Bronze, Silver, Gold, and Platinum.

I would like to use a single email template to send an email to the user to inform them that they've been rewarded and let them know when they will receive their next reward.

When I use the CASE() function, I do not receive any output.

Here is my function:

{!CASE(Contact.Chats_Reward__c,
'Ribbon',10,
'Bronze',50,
'Silver',100,
'Gold',500,
'Platinum',1000,
null)}

I've also tried it without the null or with a different value (5000 for example).

Please let me know what I'm doing wrong or what additional information is needed to assess my problem.

  • The formula, as described, works if you're emailing a Contact record. Since you're getting a blank value, that means you've not selected the correct record. The exact solution depends on how you're trying to send the email: in the standard UI, Apex Code, Workflow Rules, Flows, and Process Builder, there's ways to determine the recipient, and this recipient must be a contact record, as written. Are you sure you're using the right type of record? – sfdcfox Jun 21 '16 at 1:23
  • @sfdcfox I'm also using other custom Contact fields that are appropriately populating when doing a "Send Test and Verify Merge Fields." – Jason Ball Jun 21 '16 at 1:31
  • Check the API name, then; unlike a Formula entry, merge fields don't throw errors when they're invalid. The structure you've presented is definitely correct, as I even took the time to build it in my dev org to prove it, even though I was fairly certain it looked correct. – sfdcfox Jun 21 '16 at 1:33
  • I made sure the API name was correct. Even copied and pasted just to make absolutely certain. That was one of the first things I tried. – Jason Ball Jun 21 '16 at 1:38
  • So I did a copy of the HTML Email Template into the Plain Text version and CASE works properly for the text-only tempalte. Any ideas? – Jason Ball Jun 21 '16 at 2:02

Your Answer

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

Browse other questions tagged or ask your own question.