You need to sign in to do that
Don't have an account?
Stephen02
Formula in Email Templates
Hello - I am attempting to enter a formula into a Salesforce Email template.
The requirement is this: If a field (e.g. Case.Send_WUPSIL_Letters__c) equals a specific value (e.g. Acknowledge), then I want to display a text message (e.g. We expect to have a response to you within the next 24 hours.
The below formula is what I have thus far, but I cannot get the text to return in the email template.
Thank you for contacting us. {! IF(Case.Send_WUPSIL_Letters__c=Acknowledge,"We expect to have a response to you within the next 24 hours")}
The requirement is this: If a field (e.g. Case.Send_WUPSIL_Letters__c) equals a specific value (e.g. Acknowledge), then I want to display a text message (e.g. We expect to have a response to you within the next 24 hours.
The below formula is what I have thus far, but I cannot get the text to return in the email template.
Thank you for contacting us. {! IF(Case.Send_WUPSIL_Letters__c=Acknowledge,"We expect to have a response to you within the next 24 hours")}
{! IF(ISPICKVAL(Case.Send_WUPSIL_Letters__c, "Acknowledge"),"We expect to have a response to you within the next 24 hours", "some other text")}
If it is a text field, then use this:
{! IF(Case.Send_WUPSIL_Letters__c, "Acknowledge","We expect to have a response to you within the next 24 hours", "some other text")}
The error was that you did not provide an "else" result, the value it uses if the record doesn't meet criteria, making the formula invalid.
If you want to evaluate multiple values easily, picklist or not, you can use this:
{! CASE(Case.Send_WUPSIL_Letters__c,
"Acknowledge", "We expect to have a response to you within the next 24 hours",
"Value2", "Result2",
// and so on and so forth
"else result")
Another thing that you may or may not need to do, is put {! } around the fields. I don't know if that's necessary or not, but you could try that if errors persist. Let me know if this helps you.
Thanks,
Parker
All Answers
{! IF(ISPICKVAL(Case.Send_WUPSIL_Letters__c, "Acknowledge"),"We expect to have a response to you within the next 24 hours", "some other text")}
If it is a text field, then use this:
{! IF(Case.Send_WUPSIL_Letters__c, "Acknowledge","We expect to have a response to you within the next 24 hours", "some other text")}
The error was that you did not provide an "else" result, the value it uses if the record doesn't meet criteria, making the formula invalid.
If you want to evaluate multiple values easily, picklist or not, you can use this:
{! CASE(Case.Send_WUPSIL_Letters__c,
"Acknowledge", "We expect to have a response to you within the next 24 hours",
"Value2", "Result2",
// and so on and so forth
"else result")
Another thing that you may or may not need to do, is put {! } around the fields. I don't know if that's necessary or not, but you could try that if errors persist. Let me know if this helps you.
Thanks,
Parker
{!IF(ISPICKVAL(Case.ServiceLetters__c,"Help"),"This text will appear","NULL")}
Thanks for marking it as best.
Regards,
Parker