Send automated email and only include filled content

Topic Labels: Automations
1017 4
Showing results for 
Search instead for 
Did you mean: 
4 - Data Explorer
4 - Data Explorer

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?

4 Replies 4

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

I’d take it one step further and put the entire line in the formula:

  '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.

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.