Preventing Empty Values in the Email BodyIt is possible to prevent empty spaces or empty lines being displayed if the corresponding attribute value is missing in the referenced business object. Example use case:
Leaving out the empty values is achieved in the email template by replacing the actual label or attribute value with an indexed two-item field with the attribute value (e.g. name of the system) in position 0 and an empty string in position 1. Which of these two items is used in the email is determined by a condition expression which returns a '1' boolean value if the attribute value is empty or a '0' value if the attribute value exists. This the actual value must be in position 0 of the indexed field and the empty string must be in position 1. Example use case solution: Condition expression [not bo.system__systemname] will be used to determine which item of the indexed field will be displayed. IMPROTANT NOTE: two subsequent underscore characters are used between 'system' and 'systemname'.
Preventing an empty line in use case A) Using the syntax in use case A above would still result in an empty line in the email. To prevent this, add a break tag to the non-empty item of the indexed field and directly after the whole expression continue with the text which should be displayed on the subsequent line of the email. <%("System: %s<br>" % bo.system__systemname, "")[not bo.system__systemname]%>This is the text for the subsequent line | |||||