Here are some examples of the functions you can use with Electronic Reporting configurations.
List
STRINGJOIN
The STRINGJOIN function is useful if you need to flatten a nested listed of strings.
STRINGJOIN(list,item,delimiter)
You provide the path to the top level of the hierarchy in the first parameter (list) and then specify the path to the item to concatenate using the second parameter (item). Each item in the list is then concatenated to the next item using the delimiter provided in the third parameter (delimiter).
For example, given the following model
<Item Name="Remittance" Type="DataContainer">
<Item Name="StructuredRemittances" Type="DataContainerList">
<Item1>
<Item Name="ReferredDocuments" Type="DataContainerList">
<Item0>
<Item Name="Number" Type="String">90809</Item>
</Item0>
</Item>
</Item1>
<Item2>
<Item Name="ReferredDocuments" Type="DataContainerList">
<Item0>
<Item Name="Number" Type="String">7798</Item>
</Item0>
</Item>
</Item2>
</Item>
</Item>
The following formula:
IF(
COUNT(@.Remittance.StructuredRemittances.ReferredDocuments) > 0,
STRINGJOIN(
@.Remittance.StructuredRemittances,
@.Remittance.StructuredRemittances.ReferredDocuments.Number,
","
),
""
)
Will produce:
90809, 7798
More to follow!
ALLITEMS
ALLITEMSQUERY
COUNT
EMPTYLIST
ENUMERATE
FILTER
FIRST
FIRSTORNULL
INDEX
ISEMPTY
LIST
LISTDISTINCT
LISTJOIN
LISTOFFIELDS
LISTOFFIELDS
LISTOFFIRSTITEM
ORDERBY
REPEAT
REVERSE
SPLIT
SPLIT
SPLITLIST
SPLITLIST
SPLITLISTBYLIMIT
STRINGJOIN
WHERE
Enumerations
To map an enum to a string, we need to make use of the CASE statement:
CASE('$CollectionLetterHeader'.CollectionLetterCode,
Enums.CollectionLetterCode.CollectionLetter1, "Collection letter1",
Enums.CollectionLetterCode.CollectionLetter2, "Collection letter2",
Enums.CollectionLetterCode.CollectionLetter3, "Collection letter3",
Enums.CollectionLetterCode.CollectionLetter4, "Collection letter4",
Enums.CollectionLetterCode.Collection, "Collection",
Enums.CollectionLetterCode.All, "All",
Enums.CollectionLetterCode.CollectionPerCust, "Collection per customer",
"None" )
Leave a comment