The function ecm:coalesce returns the first not null argument from a specified list of arguments.

Example

An expression checks specific attributes and a related data set for values. If any of these sources contains data, a personalisation is inserted into a message. Rather than write an ​InsertIf​ statement to check each source, a single expression is used:

<%InsertIf expression="${ecm:coalesce(user.CustomAttribute['product ID'], group.CustomAttribute['conversion date'], user.relatedAttribute['Purchases'])=='notempty'}%>Text<%/InsertIf%>
CODE

Structure​

ecm:coalesce(object...)

Parameters​

Parameter

Description

object

Specifies the target object to be queried. Additional objects can be added as a list, separated by commas.