Collection
Collection allows the creation of lists of objects. It produces an array. Each object is made of fields represented in a fieldset
:
Example
Collections can contain a collection as a field with only one level of nesting, which also assumes that a collection can't contain itself as a field.
Below are examples of format in which values of collection type are available to a client app:
Empty collection
2 items collection
Nested collection
Item labels
Collection field can have item_label
property. If specified, item label will be displayed instead of "Item #" text.
item_label
is a handlebars template. Besides static text, field value from the fieldset can be used as a variable.
Same field type restrictions are applied as for element labels.
Limitations
Collections have these limitations:
Default values are not supported
Prefill is not supported
mandatory
flag is not supported for the collection itself, although it is supported for fields within collection items. Useitems_number
instead to specify the minimum and maximum number of items allowed in a collection. See Field set.description
optional attribute is supported for adding a tooltip for the corresponding field