Send automated email and only include filled content

I am triggering an automatic email when a record is created. I will send the name of the record and the dynamic data of each record. there are specific records that if they are empty I want to hide the data and also the name. How can I achieve this?
image

Hi @steven_hilario
If QTY-Brochure-Holder is empty, nothing will be inserted into your email body. The text string: QTY Brochure, is just text that you have added and is arbitrary to the contents of QTY-Brochure-Holder.

If you want to make QTY Brochure tied to the contents of QTY-Brochure-Holder then you can add a Formula type field with something like:

IF({QTY-Brochure-Holder}, 'QTY Brochure')

This formula will only show the word QTY Brochure if there is data in the QTY-Brochure-Holder field

Then put the results of this field in place of QTY Brochure

2 Likes

Iā€™d take it one step further and put the entire line in the formula:

IF(
  {QTY-Brochure-Holder},
  'QTY Brochure: ' & {QTY-Brochure-Holder} & '\n'
)

Note the inclusion of the newline character as well as the label. If you put the newline character in the email template, your email will have a blank line when the information is missing. You may need to fiddle with the number of newline characters and where you put the next text in the email template to get the spacing right.

3 Likes

Thank you both for your reply! would I put the code in the email Message or in a Script?

The formula goes in a formula field. Then the formula field goes in the email message.