0

Hi friends is there any way to restrict empty fields from email templates when sending email to users with workflow or any other.

I have a workflow.Whenever any record meets the criteria it will sent an email to specified users.So,in my template there are so many fields.sometimes some of the fields will be blank.So it showing some space in between.So,i don't want user to get spaces in mail.

2
  • Please be more clear, what do you mean by restrict empty fields? Jun 21 '16 at 14:11
  • I updated my question @Frederik Witte
    – Pavan tej
    Jun 21 '16 at 14:17
3

You can use IF statements in your email templates:

{!IF(NOT(ISBLANK(Object.Field)), "Field Label: " & Object.Field, "")}

Alternatively, you can use Visualforce templates and use the "rendered" attribute, like this:

<apex:outputField value="{!Object.Field}" rendered="{!NOT(ISBLANK(Object.Field))}" />
1
  • {!BLANKVALUE(Object.Field,'valueIfBlank')} can also be used in appropriate circumstances
    – cropredy
    Jun 21 '16 at 15:05

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.