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.

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

1 Answer 1


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))}" />
  • {!BLANKVALUE(Object.Field,'valueIfBlank')} can also be used in appropriate circumstances
    – cropredy
    Jun 21, 2016 at 15:05

You must log in to answer this question.

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