Suppose you have an address captured as four separate data elements. Typically the Address section of a letter would then look like:
But sometimes the fourth, or maybe even the third, lines are empty, and you normally don’t want to leave an empty line between the last non-empty address line and the
Here is what to do:
When a template like this is run, if the AddressLine3 data element is empty, then the entire line on which the fillpoint
«AddressLine3» appears will be removed from the merged document. The same applies to
Prior to version 3.9.3 (when the ShowIfHasValue function was introduced), the way to achieve the suppression of empty lines was as follows (shown here in case you have seen code like this in templates)
«If(AddressLine3 != “”)»
«If(AddressLine4 != “”)»
- When an
Ifcommand is the only text in a paragraph, then that paragraph will not appear in the merged document. The same applies to the
End()command (and numerous other commands, e.g.
ForEach, Else(), and the various
ChooseFrom...commands, etc.) which, when they are the only text in a paragraph, will result in that entire paragraph being removed from the merged document.
- The symbol
!=means “is not equal to”.