Template macro to insert a bullet-point or numbered list into a generated Microsoft Word document.
Function
list [list-of-values]
Arguments
Argument | Data Type |
list-of-records | A calculation that returns a list of records. |
Comments
The list macro keyword is used as the first keyword after MERGEFIELD in document generation macros. The macro should be the first macro inside of a bullet-point or numbered list to indicate that the calculation will return a list of results, with each result generating one item in the list.
Calculations that subsequently appear within the list item are recalculated for each record that is returned - and the record currently being processed acts as the context record for those calculations. The list macro essentially works in the same manner as the repeat macro, except that it signals that the list bullet or number also needs to participate in the repeated block.
A {MERGEFIELD end} macro may be placed at the end of a list item to indicate the end of the repeated section. For simple lists that only a single line of text this is optional - and the end of the repeated section will automatically be determined, but more complicated scenarios may require this.
Example
The following document template could be used to generate the following result. Note that any calculation that returns a list of records can be used in place of the all function.
{ MERGEFIELD list all([Fruit]) }{ MERGEFIELD [Quantity] }x { MERGEFIELD [Name] }
{ MERGEFIELD list all([Recipe Steps]) order by [Step Number]}{ MERGEFIELD [Name] }