Chloro provide a feature called "repeatable groups",
or just "groups",
in forms.

The idea is simple.
It's quite common to have a group of fields in your form that you want to repeat.
Maybe you want to offer a fixed number of repetitions,
or you might let the user add additional groups through Javascript.

A good example would be phone numbers.
The group might consist of a select field for phone numbers types (Home,
Mobile,
Work) and a text input for the phone number itself.

Processing this sort of data can be tricky.
You need to associate each group with a specific phone number,
and you need to distinguish new phone numbers from updates to existing numbers.

A group consists of a "repetition field" and a set of repeatable fields.
The repetition field is a field that contains the keys that define each group.
Typically,
this will be some combination of database ids and identifiers for new fields.

No matter how many phone numbers are present, the phone_number_id field (our repetition_key) will always contain an array reference. The values for the repetition_key field will not include keys for empty groups.