Fields
Array Builder Field
The Array Builder Field allows for the creation of array fields.
See arrays for a fundamental understanding of array data structures.
Basic usage
Adds an arraybuilder
field to the fields of an action.
You can specify the field type of new entries, this can be almost any field type in Stubber. See examples for advanced cases.
Result
The field will be displayed as an array field in the form, as below:
The resultant data that will be available in stubpost.data
will be as follows:
This can be substituted with eg. ~~stubpost.data.customer_names
where required.
Parameters
See fields for common field parameters like validation and conditional rendering.
optional object
params.new_entry_field This parameter specifies which field should be used to generate a single array value. It is a field specification of its own, and can be used to generate values of any field type.
Examples
The new_entry_field
parameter is here set to section
. This means that each item in the array will be an object, containing all of the nested fields in the section
field.
Resultant array: